Ignore:
Timestamp:
Sep 2, 2007 1:04:56 PM (6 years ago)
Author:
dkg
Message:

moved cereal command processing into a bash function in preparation for using cereal as a shell

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cereal/fs/usr/bin/cereal

    r510 r541  
    118118### MAIN 
    119119 
    120 COMMAND="$1" 
    121 [ "$COMMAND" ] || failure "Type '$CMD help' for usage." 
    122 shift 
     120handle_command() { 
    123121 
    124 case $COMMAND in 
    125     'attach'|'a') 
    126         attach "$@" 
    127         ;; 
    128     'follow'|'f') 
    129         follow "$@" 
    130         ;; 
    131     'list'|'l') 
    132         list "$@" 
    133         ;; 
    134     'help'|'h'|'?') 
    135         usage 
    136         ;; 
    137     *) 
    138         failure "Unknown command: '$COMMAND' 
     122    COMMAND="$1" 
     123 
     124    [ "$COMMAND" ] || failure "Type '$CMD help' for usage." 
     125    shift 
     126 
     127    case $COMMAND in 
     128        'attach'|'a') 
     129            attach "$@" 
     130            ;; 
     131        'follow'|'f') 
     132            follow "$@" 
     133            ;; 
     134        'list'|'l') 
     135            list "$@" 
     136            ;; 
     137        'help'|'h'|'?') 
     138            usage 
     139            ;; 
     140        *) 
     141            failure "Unknown command: '$COMMAND' 
    139142Type '$CMD help' for usage." 
    140         ;; 
    141 esac 
     143            ;; 
     144    esac 
     145} 
     146 
     147handle_command "$@" 
Note: See TracChangeset for help on using the changeset viewer.