"Fossies" - the Fresh Open Source Software Archive

Member "argbash-2.10.0/tests/regressiontests/basic.m4" (22 Sep 2020, 1444 Bytes) of package /linux/privat/argbash-2.10.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "basic.m4": 2.9.0_vs_2.10.0.

    1 #!/bin/bash
    2 
    3 set -e
    4 
    5 m4_define([pos_arg], [m4_fatal([The option string '$0' got expanded])])
    6 m4_define([_arg_pos_arg], [m4_fatal([The variable name '$0' got expanded])])
    7 m4_define([pos_opt_default], [m4_fatal([The pos-opt default '$0' got expanded])])
    8 m4_define([pos_arg_help], [m4_fatal([The option 'pos_arg' help string got expanded])])
    9 m4_define([opt_arg], [m4_fatal([The option string '$0' got expanded])])
   10 m4_define([opt_arg_default], [m4_fatal([The opt_arg default '$0' got expanded])])
   11 m4_define([opt_arg_help], [m4_fatal([The option 'opt_arg' help string got expanded])])
   12 
   13 # ARG_POSITIONAL_SINGLE([pos_arg], [pos_arg_help P percent: %])
   14 # ARG_POSITIONAL_SINGLE([pos-opt], [@pos-opt-arg@], [pos_opt_default lala])
   15 # ARG_OPTIONAL_SINGLE([opt_arg], o, [opt_arg_help O percent: %], [opt_arg_default lolo])
   16 # ARG_USE_ENV([FOO], [foo], [help on foo])
   17 # ARG_USE_PROGRAM([make], [MAKE], [Please install GNU make to use this test], [The GNU make utility])
   18 # ARG_DEFAULTS_POS()
   19 # ARG_VERSION([echo "$0 FOO"])
   20 # ARG_OPTIONAL_BOOLEAN(boo_l, b)
   21 # ARG_OPTIONAL_INCREMENTAL([opt-incr], i, [@pos-opt-arg@], 2)
   22 # ARG_HELP([Testing program])
   23 # ARGBASH_GO
   24 
   25 # opening escape square bracket: [
   26 
   27 # Now we take the parsed data and assign them no nice-looking variable names,
   28 # sometimes after a basic validation
   29 echo "BOOL=$_arg_boo_l,OPT_S=$_arg_opt_arg,POS_S=$_arg_pos_arg,POS_OPT=$_arg_pos_opt,OPT_INCR=$_arg_opt_incr,"
   30 
   31 # closing escape square bracket: ]