This commit is contained in:
sagie gur ari 2020-01-03 10:34:39 +00:00
parent 50ed0f8625
commit 5fc5a934e0
2 changed files with 51 additions and 39 deletions

View file

@ -1,41 +1,41 @@
# Table of Contents
* [sdk::Alias](#sdk__Alias)
* [sdk::Array](#sdk__Array)
* [sdk::Echo](#sdk__Echo)
* [sdk::Eval](#sdk__Eval)
* [sdk::ForIn](#sdk__ForIn)
* [sdk::Function](#sdk__Function)
* [sdk::GoTo](#sdk__GoTo)
* [sdk::If](#sdk__If)
* [sdk::Not](#sdk__Not)
* [sdk::Release](#sdk__Release)
* [sdk::Set](#sdk__Set)
* [sdk::ShowCommandDocumentation](#sdk__ShowCommandDocumentation)
* [sdk::Unalias](#sdk__Unalias)
* [sdk::env::GetVar](#sdk__env__GetVar)
* [sdk::env::PrintCurrentDirectory](#sdk__env__PrintCurrentDirectory)
* [sdk::env::SetCurrentDirectory](#sdk__env__SetCurrentDirectory)
* [sdk::env::SetVar](#sdk__env__SetVar)
* [sdk::env::UnsetVar](#sdk__env__UnsetVar)
* [sdk::fs::CopyPath](#sdk__fs__CopyPath)
* [sdk::fs::CreateDirectory](#sdk__fs__CreateDirectory)
* [sdk::fs::CreateEmptyFile](#sdk__fs__CreateEmptyFile)
* [sdk::fs::DeleteEmptyDirectory](#sdk__fs__DeleteEmptyDirectory)
* [sdk::fs::DeletePath](#sdk__fs__DeletePath)
* [sdk::fs::GetCanonicalPath](#sdk__fs__GetCanonicalPath)
* [sdk::fs::GetFileName](#sdk__fs__GetFileName)
* [sdk::fs::GetParentDirectory](#sdk__fs__GetParentDirectory)
* [sdk::fs::MovePath](#sdk__fs__MovePath)
* [sdk::fs::Print](#sdk__fs__Print)
* [sdk::fs::Read](#sdk__fs__Read)
* [sdk::fs::Write](#sdk__fs__Write)
* [sdk::math::Calc](#sdk__math__Calc)
* [sdk::process::Execute](#sdk__process__Execute)
* [sdk::process::Exit](#sdk__process__Exit)
* [sdk::test::Assert](#sdk__test__Assert)
* [sdk::test::AssertEquals](#sdk__test__AssertEquals)
* [sdk::test::AssertFail](#sdk__test__AssertFail)
* [sdk::thread::Sleep](#sdk__thread__Sleep)
* [sdk::Alias (alias)](#sdk__Alias)
* [sdk::Array (array)](#sdk__Array)
* [sdk::Echo (echo)](#sdk__Echo)
* [sdk::Eval (eval)](#sdk__Eval)
* [sdk::ForIn (for)](#sdk__ForIn)
* [sdk::Function (function, fn)](#sdk__Function)
* [sdk::GoTo (goto)](#sdk__GoTo)
* [sdk::If (if)](#sdk__If)
* [sdk::Not (not)](#sdk__Not)
* [sdk::Release (release)](#sdk__Release)
* [sdk::Set (set)](#sdk__Set)
* [sdk::ShowCommandDocumentation (man)](#sdk__ShowCommandDocumentation)
* [sdk::Unalias (unalias)](#sdk__Unalias)
* [sdk::env::GetVar (get_env)](#sdk__env__GetVar)
* [sdk::env::PrintCurrentDirectory (pwd)](#sdk__env__PrintCurrentDirectory)
* [sdk::env::SetCurrentDirectory (cd, set_current_dir)](#sdk__env__SetCurrentDirectory)
* [sdk::env::SetVar (set_env)](#sdk__env__SetVar)
* [sdk::env::UnsetVar (unset_env)](#sdk__env__UnsetVar)
* [sdk::fs::CopyPath (cp)](#sdk__fs__CopyPath)
* [sdk::fs::CreateDirectory (mkdir)](#sdk__fs__CreateDirectory)
* [sdk::fs::CreateEmptyFile (touch)](#sdk__fs__CreateEmptyFile)
* [sdk::fs::DeleteEmptyDirectory (rmdir)](#sdk__fs__DeleteEmptyDirectory)
* [sdk::fs::DeletePath (rm)](#sdk__fs__DeletePath)
* [sdk::fs::GetCanonicalPath (canonicalize)](#sdk__fs__GetCanonicalPath)
* [sdk::fs::GetFileName (basename)](#sdk__fs__GetFileName)
* [sdk::fs::GetParentDirectory (dirname)](#sdk__fs__GetParentDirectory)
* [sdk::fs::MovePath (mv)](#sdk__fs__MovePath)
* [sdk::fs::Print (cat)](#sdk__fs__Print)
* [sdk::fs::Read (readfile)](#sdk__fs__Read)
* [sdk::fs::Write (writefile)](#sdk__fs__Write)
* [sdk::math::Calc (calc)](#sdk__math__Calc)
* [sdk::process::Execute (exec)](#sdk__process__Execute)
* [sdk::process::Exit (exit)](#sdk__process__Exit)
* [sdk::test::Assert (assert)](#sdk__test__Assert)
* [sdk::test::AssertEquals (assert_eq)](#sdk__test__AssertEquals)
* [sdk::test::AssertFail (assert_fail)](#sdk__test__AssertFail)
* [sdk::thread::Sleep (sleep)](#sdk__thread__Sleep)
<a name="sdk__Alias"></a>

View file

@ -53,10 +53,22 @@ impl Command for CommandImpl {
match commands.get(name) {
Some(command) => {
if !command.help().is_empty() {
let aliases = command.aliases();
let aliases_line = if !aliases.is_empty() {
let mut aliases_docs_buffer = aliases.join(", ");
aliases_docs_buffer.insert_str(0, " (");
aliases_docs_buffer.push_str(")");
aliases_docs_buffer
} else {
"".to_string()
};
buffer.push_str(&format!(
"* [{}](#{})\n",
"* [{}{}](#{})\n",
name,
name.replace(":", "_")
aliases_line,
name.replace(":", "_"),
));
}
}