<code>function shapeshift
argparse 'h/help' -- $argv
if not set -q argv[1] $argv or if set -q _flag_help
echo "Shapeshift lets you change into another root system."
echo "It is a simple tool that mounts, and chroots a partition of your choice."
echo ""
echo "Use it in the following way:"
set_color green; echo "shapeshift nvme0n1p4"; set_color normal
echo ""
echo "Here is a list of the available partitions:"
echo ""
sudo lsblk -o NAME,SIZE,MOUNTPOINTS,TYPE | awk '$4 == "part"'
end
end
</code>
<code>function shapeshift
argparse 'h/help' -- $argv
if not set -q argv[1] $argv or if set -q _flag_help
echo "Shapeshift lets you change into another root system."
echo "It is a simple tool that mounts, and chroots a partition of your choice."
echo ""
echo "Use it in the following way:"
set_color green; echo "shapeshift nvme0n1p4"; set_color normal
echo ""
echo "Here is a list of the available partitions:"
echo ""
sudo lsblk -o NAME,SIZE,MOUNTPOINTS,TYPE | awk '$4 == "part"'
end
end
</code>
function shapeshift
argparse 'h/help' -- $argv
if not set -q argv[1] $argv or if set -q _flag_help
echo "Shapeshift lets you change into another root system."
echo "It is a simple tool that mounts, and chroots a partition of your choice."
echo ""
echo "Use it in the following way:"
set_color green; echo "shapeshift nvme0n1p4"; set_color normal
echo ""
echo "Here is a list of the available partitions:"
echo ""
sudo lsblk -o NAME,SIZE,MOUNTPOINTS,TYPE | awk '$4 == "part"'
end
end
I cant seem to get both, calling with an argument and calling with –help, seem to get working at the same time.
I tried several different versions of this code, and always seems to break the code, once I chain both events together by an or. No matter which one I call first, or if I use a separate if statement in front of the second command or not. It always seems to fail.
New contributor
Matthias Schuster is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.