Changeset 103 for confman/confman


Ignore:
Timestamp:
05/18/2006 20:41:10 (6 years ago)
Author:
ccowart
Message:

Implementing the confman rename function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • confman/confman

    r101 r103  
    565565} 
    566566 
     567function rename { 
     568        local oldmod=$1 
     569        local newmod=$2 
     570        if [ -z $newmod ] ; then 
     571                print_usage 1 
     572        fi 
     573        if [ ! -d "${WORK_PATH}/${oldmod}" ] ; then 
     574                echo "${MYNAME}: Error: ${WORK_PATH}/${oldmod} doesn't exist" >&4 
     575                conf_cleanexit 
     576        fi 
     577        if [ -e "${WORK_PATH}/${newmod}" ] ; then 
     578                echo "${MYNAME}: Error: ${WORK_PATH}/${newmod}: file exists" >&4 
     579                conf_cleanexit 
     580        fi 
     581        conf_rename $oldmod $newmod 
     582} 
     583 
    567584function diff { 
    568585        conf_diff $* 
     
    609626shift 
    610627case $subcommand in 
    611         help ) 
    612                 print_help $* 
    613                 exit 0 
    614                 ;; 
    615         setup|se* ) 
    616                 setup $* 
    617                 ;; 
    618         status|st* ) 
    619                 status $* 
    620                 ;; 
    621         create|cr* ) 
    622                 create $* 
    623                 ;; 
    624         update|u* ) 
    625                 update $* 
    626                 ;; 
    627         commit|com* ) 
    628                 commit $* 
    629                 ;; 
    630         import|im* ) 
    631                 import $* 
    632                 ;; 
    633         install|in* ) 
    634                 inst $* 
    635                 ;; 
    636         remove|rem*|rm ) 
    637                 remove $* 
    638                 ;; 
    639         rev* ) 
    640                 revert $* 
    641                 ;; 
    642         rmmod ) 
    643                 rmmod $* 
    644                 ;; 
    645         mkdir|mkd* ) 
    646                 newdir $* 
    647                 ;; 
    648         list|ls ) 
    649                 list $* 
    650                 ;; 
    651         move|mv ) 
    652                 move $* 
    653                 ;; 
    654         copy|cp ) 
    655                 copy $* 
    656                 ;; 
    657         diff ) 
    658                 diff $* 
    659                 ;; 
    660         log ) 
    661                 log $* 
    662                 ;; 
    663         chmod ) 
    664                 chmode $* 
    665                 ;; 
    666         chown ) 
    667                 chowner $* 
    668                 ;; 
    669         chcom ) 
    670                 chcom $* 
    671                 ;; 
    672         chgrp ) 
    673                 chgroup $* 
    674                 ;; 
    675         checklook|checklist|chls|chlk ) 
    676                 checklook $* 
    677                 ;; 
    678         checknew|chnw ) 
    679                 checknew $* 
    680                 ;; 
    681         checkclear|chcl|chrm ) 
    682                 checkclear $* 
    683                 ;; 
    684         rollback|ro* ) 
    685                 rollback $* 
    686                 ;; 
    687         * ) 
    688                 print_usage 1 
    689                 ;; 
    690 esac 
     628        help )                                                  print_help $* ; exit 0 ;; 
     629        setup|se* )                                             setup $* ;; 
     630        status|st* )                                    status $* ;; 
     631        create|cr* )                                    create $* ;; 
     632        update|u* )                                             update $* ;; 
     633        commit|com* )                                   commit $* ;; 
     634        import|im* )                                    import $* ;; 
     635        install|in* )                                   inst $* ;; 
     636        remove|rem*|rm )                                remove $* ;; 
     637        rev* )                                                  revert $* ;; 
     638        ren* )                                                  rename $* ;; 
     639        rmmod )                                                 rmmod $* ;; 
     640        mkdir|mkd* )                                    newdir $* ;; 
     641        list|ls )                                               list $* ;; 
     642        move|mv )                                               move $* ;; 
     643        copy|cp )                                               copy $* ;; 
     644        diff )                                                  diff $* ;; 
     645        log )                                                   log $* ;; 
     646        chmod )                                                 chmode $* ;; 
     647        chown )                                                 chowner $* ;; 
     648        chcom )                                                 chcom $* ;; 
     649        chgrp )                                                 chgroup $* ;; 
     650        checklook|checklist|chls|chlk ) checklook $* ;; 
     651        checknew|chnw )                                 checknew $* ;; 
     652        checkclear|chcl|chrm )                  checkclear $* ;; 
     653        rollback|ro* )                                  rollback $* ;; 
     654        * )                                                             print_usage 1 ;; 
     655esac  
    691656 
    692657# We shouldn't be here. 
    693658exit 1 
    694659 
     660# vim:ts=4 
     661 
Note: See TracChangeset for help on using the changeset viewer.