2015-12-20 17:57:51 -02:00
|
|
|
function omf.cli.remove -a name
|
|
|
|
switch (count $argv)
|
|
|
|
case 1
|
|
|
|
omf.packages.remove $name
|
|
|
|
set code $status
|
|
|
|
|
|
|
|
switch $code
|
|
|
|
case 0
|
|
|
|
echo (omf::em)"$name successfully removed."(omf::off)
|
2016-02-23 22:59:10 -03:00
|
|
|
# Opt-in flag for testing
|
|
|
|
set -q OMF_AUTO_RELOAD
|
2017-02-12 23:02:42 -06:00
|
|
|
and omf.reload
|
2015-12-20 17:57:51 -02:00
|
|
|
case 1
|
2016-12-17 20:26:46 -06:00
|
|
|
echo (omf::err)"$name could not be removed."(omf::off) >&2
|
2015-12-20 17:57:51 -02:00
|
|
|
case 2
|
2016-12-17 20:26:46 -06:00
|
|
|
echo (omf::err)"$name could not be found."(omf::off) >&2
|
2015-12-20 17:57:51 -02:00
|
|
|
end
|
|
|
|
|
|
|
|
return $code
|
|
|
|
|
|
|
|
case '*'
|
2016-12-17 20:26:46 -06:00
|
|
|
echo (omf::err)"Invalid number of arguments"(omf::off) >&2
|
|
|
|
echo "Usage: omf remove "(omf::em)"<name>"(omf::off) >&2
|
2015-12-20 17:57:51 -02:00
|
|
|
return $OMF_INVALID_ARG
|
|
|
|
end
|
|
|
|
end
|