Update of /cvsroot/pure-data/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23314
Modified Files: config-switcher.sh Log Message: added print and diff capabilities so you can see the files and any changes that have been made
Index: config-switcher.sh =================================================================== RCS file: /cvsroot/pure-data/scripts/config-switcher.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** config-switcher.sh 16 Oct 2005 00:19:21 -0000 1.3 --- config-switcher.sh 19 Nov 2005 23:10:22 -0000 1.4 *************** *** 19,22 **** --- 19,28 ---- echo " $0 list" echo " " + echo "To print the contents of a config:" + echo " $0 print CONFIG_NAME" + echo " " + echo "To see the difference between the current config and another:" + echo " $0 diff CONFIG_NAME" + echo " " echo "To use the .pdrc instead, add '--pdrc':" echo " $0 --pdrc load CONFIG_NAME" *************** *** 24,27 **** --- 30,35 ---- echo " $0 --pdrc delete CONFIG_NAME" echo " $0 --pdrc list" + echo " $0 --pdrc print CONFIG_NAME" + echo " $0 --pdrc diff CONFIG_NAME" exit } *************** *** 30,34 **** # THE PROGRAM
! if [ $# -eq 0 ]; then print_usage else --- 38,42 ---- # THE PROGRAM
! if [ $# -lt 1 ]; then print_usage else *************** *** 62,80 **** cd $CONFIG_DIR ! save_file="$CONFIG_DIR/$CONFIG_FILE-$CONFIG_NAME" case $COMMAND in load) ! if [ -e "$save_file" ]; then ! test -e "$CONFIG_FILE" && mv "$CONFIG_FILE" /tmp ! rm "$CONFIG_FILE" ! cp "$save_file" "$CONFIG_FILE" && \ ! echo "Pd config "$save_file" loaded." else ! echo ""$save_file" doesn't exist. No action taken." fi ;; save) ! if [ -e "$CONFIG_DIR/$CONFIG_FILE" ]; then ! cp "$CONFIG_FILE" "$save_file" && \ echo "Pd config "$CONFIG_NAME" saved." else --- 70,87 ---- cd $CONFIG_DIR ! selected_file="$CONFIG_DIR/$CONFIG_FILE-$CONFIG_NAME" case $COMMAND in load) ! if [ -e "$selected_file" ]; then ! test -e "$CONFIG_FILE" && mv -f "$CONFIG_FILE" /tmp ! cp "$selected_file" "$CONFIG_FILE" && \ ! echo "Pd config "$selected_file" loaded." else ! echo ""$selected_file" doesn't exist. No action taken." fi ;; save) ! if [ -e "$CONFIG_FILE" ]; then ! cp -f "$CONFIG_FILE" "$selected_file" && \ echo "Pd config "$CONFIG_NAME" saved." else *************** *** 83,96 **** ;; delete) ! if [ -e "$save_file" ]; then ! rm "$save_file" && \ ! echo "Pd config "$save_file" deleted." else ! echo ""$save_file" doesn't exist. No action taken." fi ;; list) echo "Available configs:" ! \ls -1 ${CONFIG_FILE}* ;; *) print_usage ;; --- 90,115 ---- ;; delete) ! if [ -e "$selected_file" ]; then ! rm -f "$selected_file" && \ ! echo "Pd config "$selected_file" deleted." else ! echo ""$selected_file" doesn't exist. No action taken." fi ;; list) echo "Available configs:" ! pwd ! ls -1 "${CONFIG_FILE}"* ! pwd ! ;; ! print) ! if [ "${CONFIG_NAME}" == "" ]; then ! cat "${CONFIG_FILE}" ! else ! cat "$selected_file" ! fi ! ;; ! diff) ! diff -uw "${CONFIG_FILE}" "$selected_file" ;; *) print_usage ;;