Commit 2e5761ab authored by Bruno's avatar Bruno

Merge pull request #90 from oh-my-fish/commands-organization

Organize commands and remove undocumented aliases
parents 4446cbc7 46e4d036
function omf.help -a type_flag
switch $type_flag
case "i" "install" "get"
function omf.help -a command
switch $command
case "c" "cd"
echo \n"\
Install packages.
Change directory to root or plugin/theme directory.
"(omf::dim)"Usage:"(omf::off)"
omf install Install missing packages from bundle
omf install "(omf::em)"<name>"(omf::off)" | "(omf::em)"<url>"(omf::off)" Install package by name or URL
omf cd Change to Oh My Fish root folder
omf cd "(omf::em)"<package name>"(omf::off)" | "(omf::em)"<theme name>"(omf::off)" Change to plugin or theme directory by name
"(omf::dim)"Examples:"(omf::off)"
omf install
omf install brew
omf install https://github.com/oh-my-fish/plugin-brew
omf cd
omf cd brew
omf cd l
"
case "u" "up" "upd" "update"
case "d" "describe"
echo \n"\
Update Oh My Fish.
Get information about what packages do.
"(omf::dim)"Usage:"(omf::off)"
omf update
omf describe Get information from all available packages
omf describe "(omf::em)"<name>"(omf::off)" Get information from package by name
"(omf::dim)"Examples:"(omf::off)"
omf describe
omf describe brew
"
case "destroy"
......@@ -30,66 +35,66 @@ function omf.help -a type_flag
omf destroy
"
case "l" "li" "lis" "lst" "list"
case "i" "install" "get"
echo \n"\
List local packages.
Install packages.
"(omf::dim)"Usage:"(omf::off)"
omf list
omf install Install missing packages from bundle
omf install "(omf::em)"<name>"(omf::off)" | "(omf::em)"<url>"(omf::off)" Install package by name or URL
"(omf::dim)"Examples:"(omf::off)"
omf install
omf install brew
omf install https://github.com/oh-my-fish/plugin-brew
"
case "t" "theme"
case "l" "ls" "list"
echo \n"\
Install and list themes.
List local packages.
"(omf::dim)"Usage:"(omf::off)"
omf theme List available themes to install
omf theme "(omf::em)"<name>"(omf::off)" Install theme by name
"(omf::dim)"Examples:"(omf::off)"
omf theme
omf theme l
omf list
"
case "r" "rem" "rm" "remove" "uninstall"
case "n" "new"
echo \n"\
Remove a theme or package.
Create a new package from a template.
"(omf::dim)"Usage:"(omf::off)"
omf remove "(omf::em)"<package name>"(omf::off)" | "(omf::em)"<theme name>"(omf::off)" Removes a theme or package by name
omf new ("(omf::dim)"pkg"(omf::off)" | "(omf::dim)"theme"(omf::off)") "(omf::em)"<name>"(omf::off)" Create a new package from a template
"(omf::dim)"Examples:"(omf::off)"
omf remove brew
omf remove l
omf new pkg mypkg
omf new theme mytheme
"
case "c" "cd"
case "q" "query"
echo \n"\
Change directory to root or plugin/theme directory.
Query environment variables.
"(omf::dim)"Usage:"(omf::off)"
omf cd Change to Oh My Fish root folder
omf cd "(omf::em)"<package name>"(omf::off)" | "(omf::em)"<theme name>"(omf::off)" Change to plugin or theme directory by name
omf query ["(omf::em)"<name>"(omf::off)"] Query environment variables
"(omf::dim)"Examples:"(omf::off)"
omf cd
omf cd brew
omf cd l
omf query
omf query path
omf query version
"
case "n" "nw" "new"
case "r" "rm" "remove" "uninstall"
echo \n"\
Create a new package from a template.
Remove a theme or package.
"(omf::dim)"Usage:"(omf::off)"
omf new ("(omf::dim)"pkg"(omf::off)" | "(omf::dim)"theme"(omf::off)") "(omf::em)"<name>"(omf::off)" Create a new package from a template
omf remove "(omf::em)"<package name>"(omf::off)" | "(omf::em)"<theme name>"(omf::off)" Removes a theme or package by name
"(omf::dim)"Examples:"(omf::off)"
omf new pkg mypkg
omf new theme mytheme
omf remove brew
omf remove l
"
case "s" "su" "sub" "submit"
case "s" "submit"
echo \n"\
Submit a package to the registry.
......@@ -101,30 +106,25 @@ function omf.help -a type_flag
omf submit theme https://github.com/oh-my-fish/plugin-mythemes
"
case "q" "query"
case "t" "theme"
echo \n"\
Query environment variables.
Install and list themes.
"(omf::dim)"Usage:"(omf::off)"
omf query ["(omf::em)"<name>"(omf::off)"] Query environment variables
omf theme List available themes to install
omf theme "(omf::em)"<name>"(omf::off)" Install theme by name
"(omf::dim)"Examples:"(omf::off)"
omf query
omf query path
omf query version
omf theme
omf theme l
"
case "d" "desc" "describe"
case "u" "update"
echo \n"\
Get information about what packages do.
Update Oh My Fish.
"(omf::dim)"Usage:"(omf::off)"
omf describe Get information from all available packages
omf describe "(omf::em)"<name>"(omf::off)" Get information from package by name
"(omf::dim)"Examples:"(omf::off)"
omf describe
omf describe brew
omf update
"
case "*"
......
......@@ -73,16 +73,16 @@ function omf -d "Oh My Fish"
return $OMF_INVALID_ARG
end
case "l" "li" "lis" "lst" "list"
omf.list_local_packages | column
case "d" "desc" "describe"
case "d" "describe"
if test (count $argv) -eq 1
omf.describe
else
omf.describe $argv[2..-1]
end
case "destroy"
omf.destroy
case "i" "install" "get"
if test (count $argv) -eq 1
omf.bundle.install
......@@ -91,6 +91,35 @@ function omf -d "Oh My Fish"
refresh
end
case "l" "ls" "list"
omf.list_local_packages | column
case "n" "new"
if test (count $argv) -ne 3
echo (omf::err)"Package type or name missing"(omf::off) 1^&2
echo "Usage: $_ "(omf::em)"$argv[1]"(omf::off)" "(omf::em)"pkg|theme"(omf::off)" <name>" 1^&2
return $OMF_MISSING_ARG
end
omf.new $argv[2..-1]
case "r" "rm" "remove" "uninstall"
if test (count $argv) -ne 2
echo (omf::err)"Invalid number of arguments"(omf::off) 1^&2
echo "Usage: $_ "(omf::em)"$argv[1]"(omf::off)" <[package|theme] name>" 1^&2
return $OMF_INVALID_ARG
end
omf.remove_package $argv[2] ; and refresh
case "s" "submit"
switch (count $argv)
case 3
omf.submit $argv[2] $argv[3]
case "*"
echo (omf::err)"Argument missing"(omf::off) 1^&2
echo "Usage: $_ "(omf::em)"$argv[1]"(omf::off)" "(omf::em)"pkg|themes"(omf::off)"/<name> <url>" 1^&2
return $OMF_MISSING_ARG
end
case "t" "theme"
if test (count $argv) -eq 1
set -l ostype (uname)
......@@ -110,15 +139,7 @@ function omf -d "Oh My Fish"
return $OMF_INVALID_ARG
end
case "r" "rem" "rm" "remove" "uninstall"
if test (count $argv) -ne 2
echo (omf::err)"Invalid number of arguments"(omf::off) 1^&2
echo "Usage: $_ "(omf::em)"$argv[1]"(omf::off)" <[package|theme] name>" 1^&2
return $OMF_INVALID_ARG
end
omf.remove_package $argv[2] ; and refresh
case "u" "up" "upd" "update"
case "u" "update"
echo (omf::em)"Updating Oh My Fish..."(omf::off)
if omf.repo.pull $OMF_PATH
echo (omf::em)"Oh My Fish is up to date."(omf::off)
......@@ -130,27 +151,6 @@ function omf -d "Oh My Fish"
omf.install_package (omf.list_installed_packages)
refresh
case "s" "su" "sub" "submit"
switch (count $argv)
case 3
omf.submit $argv[2] $argv[3]
case "*"
echo (omf::err)"Argument missing"(omf::off) 1^&2
echo "Usage: $_ "(omf::em)"$argv[1]"(omf::off)" "(omf::em)"pkg|themes"(omf::off)"/<name> <url>" 1^&2
return $OMF_MISSING_ARG
end
case "n" "nw" "new"
if test (count $argv) -ne 3
echo (omf::err)"Package type or name missing"(omf::off) 1^&2
echo "Usage: $_ "(omf::em)"$argv[1]"(omf::off)" "(omf::em)"pkg|theme"(omf::off)" <name>" 1^&2
return $OMF_MISSING_ARG
end
omf.new $argv[2..-1]
case "destroy"
omf.destroy
case "*"
echo (omf::err)"$argv[1] option not recognized"(omf::off) 1^&2
return $OMF_UNKNOWN_OPT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment