Quantcast
Channel: Active questions tagged fish - Stack Overflow
Viewing all articles
Browse latest Browse all 106

Why does the or operator in fish seem to not work

$
0
0
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"'   endend

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.


Viewing all articles
Browse latest Browse all 106

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>