Browse Source

Add usage error

Alois Mahdal 5 years ago
parent
commit
011593cfb0
1 changed files with 1 additions and 0 deletions
  1. 1
    0
      dotfiles/bash/main.bashrc

+ 1
- 0
dotfiles/bash/main.bashrc View File

88
     # Check if YAML file $1 is loadable
88
     # Check if YAML file $1 is loadable
89
     #
89
     #
90
     local yfile=$1
90
     local yfile=$1
91
+    test -n "$yfile" || { echo "usage: ckyaml FILE.yaml"; return 2; }
91
     python -c 'import yaml; import sys; print(yaml.load(sys.stdin)["this"])' <"$yfile"
92
     python -c 'import yaml; import sys; print(yaml.load(sys.stdin)["this"])' <"$yfile"
92
 }
93
 }
93
 
94