Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ion
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Enzo Cioppettini
ion
Commits
2f5c7ddb
Unverified
Commit
2f5c7ddb
authored
7 years ago
by
Michael Aaron Murphy
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #618 from dlrobertson/master
Improve bad argument parsing of setup.ion
parents
615818e0
b38d845d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
setup.ion
+16
-7
16 additions, 7 deletions
setup.ion
with
16 additions
and
7 deletions
setup.ion
+
16
−
7
View file @
2f5c7ddb
...
@@ -20,22 +20,31 @@ fn print_option definition description
...
@@ -20,22 +20,31 @@ fn print_option definition description
echo " ${c::bold}- ${c::0x0CF}$definition: ${c::reset}$description"
echo " ${c::bold}- ${c::0x0CF}$definition: ${c::reset}$description"
end
end
# In case a bad argument was supplied, this will be used.
# Print all available options
fn bad_arg argument
fn show_options
echo -e "${c::0xF60,bold}Error: ${c::0xF06}`$argument`${c::0xF60} is \
echo -e "${c::0x0F6}Available options for this script are:${c::reset}"
not a valid command.${c::reset}\n${c::0x0F6}Available options for \
this script are:${c::reset}"
print_option "build ion" " Build the Ion shell"
print_option "build ion" " Build the Ion shell"
print_option "build docs" " Build the Ion mdBook"
print_option "build docs" " Build the Ion mdBook"
print_option "install ion" " Install the Ion Shell"
print_option "install ion" " Install the Ion Shell"
print_option "install docs" " Install the Ion mdBook"
print_option "install docs" " Install the Ion mdBook"
print_option "install plugins" "Install official Ion plugins"
print_option "install plugins" "Install official Ion plugins"
print_option "uninstall ion" " Removes Ion from System"
print_option "uninstall ion" " Removes Ion from System"
end
# In case a bad argument was supplied, this will be used.
fn bad_arg argument
echo -e "${c::0xF60,bold}Error: ${c::0xF06}`$argument`${c::0xF60} is \
not a valid command.${c::reset}"
show_options
exit
exit
end
end
# Arguments are required!
# Arguments are required!
if test 1 -eq $len(@args); bad_arg; end
if test 1 -eq $len(@args)
echo -e "${c::0xF60,bold}Error: must proved command.${c::reset}"
show_options
exit
end
# Rust/Cargo is required!
# Rust/Cargo is required!
if not exists -b "cargo"
if not exists -b "cargo"
...
@@ -77,4 +86,4 @@ match "@args[1..3]"
...
@@ -77,4 +86,4 @@ match "@args[1..3]"
sudo rm ${SHAREDIR} -R
sudo rm ${SHAREDIR} -R
case _
case _
bad_arg "@args[1..3]"
bad_arg "@args[1..3]"
end
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment