/[tar]/tar/src/tar.c
ViewVC logotype

Diff of /tar/src/tar.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.64 by gray, Thu Sep 4 13:59:35 2003 UTC revision 1.65 by gray, Thu Sep 4 15:48:02 2003 UTC
# Line 200  enum Line 200  enum
200    REMOVE_FILES_OPTION,    REMOVE_FILES_OPTION,
201    RSH_COMMAND_OPTION,    RSH_COMMAND_OPTION,
202    SHOW_OMITTED_DIRS_OPTION,    SHOW_OMITTED_DIRS_OPTION,
203      STRIP_PATH_OPTION,
204    SUFFIX_OPTION,    SUFFIX_OPTION,
205    TOTALS_OPTION,    TOTALS_OPTION,
206    USE_COMPRESS_PROGRAM_OPTION,    USE_COMPRESS_PROGRAM_OPTION,
# Line 299  static struct option long_options[] = Line 300  static struct option long_options[] =
300    {"show-omitted-dirs", no_argument, 0, SHOW_OMITTED_DIRS_OPTION},    {"show-omitted-dirs", no_argument, 0, SHOW_OMITTED_DIRS_OPTION},
301    {"sparse", no_argument, 0, 'S'},    {"sparse", no_argument, 0, 'S'},
302    {"starting-file", required_argument, 0, 'K'},    {"starting-file", required_argument, 0, 'K'},
303      {"strip-path", required_argument, 0, STRIP_PATH_OPTION },
304    {"suffix", required_argument, 0, SUFFIX_OPTION},    {"suffix", required_argument, 0, SUFFIX_OPTION},
305    {"tape-length", required_argument, 0, 'L'},    {"tape-length", required_argument, 0, 'L'},
306    {"to-stdout", no_argument, 0, 'O'},    {"to-stdout", no_argument, 0, 'O'},
# Line 451  Local file selection:\n\ Line 453  Local file selection:\n\
453    -h, --dereference            dump instead the files symlinks point to\n\    -h, --dereference            dump instead the files symlinks point to\n\
454        --no-recursion           avoid descending automatically in directories\n\        --no-recursion           avoid descending automatically in directories\n\
455    -l, --one-file-system        stay in local file system when creating archive\n\    -l, --one-file-system        stay in local file system when creating archive\n\
456    -K, --starting-file=NAME     begin at file NAME in the archive\n"),    -K, --starting-file=NAME     begin at file NAME in the archive\n\
457          --strip-path=NUM         strip NUM leading components from file names\n\
458                                   before extraction\n"),
459               stdout);               stdout);
460  #if !MSDOS  #if !MSDOS
461        fputs (_("\        fputs (_("\
# Line 550  decode_options (int argc, char **argv) Line 554  decode_options (int argc, char **argv)
554    char const *backup_suffix_string;    char const *backup_suffix_string;
555    char const *version_control_string = 0;    char const *version_control_string = 0;
556    int exclude_options = EXCLUDE_WILDCARDS;    int exclude_options = EXCLUDE_WILDCARDS;
557    int o_option = 0;    bool o_option = 0;
558        
559    /* Set some default option values.  */    /* Set some default option values.  */
560    
# Line 671  decode_options (int argc, char **argv) Line 675  decode_options (int argc, char **argv)
675             BSD-derived systems.  This is a consequence of the block/record             BSD-derived systems.  This is a consequence of the block/record
676             terminology confusion.  */             terminology confusion.  */
677    
678          read_full_records_option = 1;          read_full_records_option = true;
679          break;          break;
680    
681        case 'c':        case 'c':
# Line 703  decode_options (int argc, char **argv) Line 707  decode_options (int argc, char **argv)
707             script at the end of each tape.  */             script at the end of each tape.  */
708    
709          info_script_option = optarg;          info_script_option = optarg;
710          multi_volume_option = 1;          multi_volume_option = true;
711          break;          break;
712    
713        case 'g':        case 'g':
714          listed_incremental_option = optarg;          listed_incremental_option = optarg;
715          after_date_option = 1;          after_date_option = true;
716          /* Fall through.  */          /* Fall through.  */
717    
718        case 'G':        case 'G':
# Line 716  decode_options (int argc, char **argv) Line 720  decode_options (int argc, char **argv)
720             directories at the beginning of the archive, and include in each             directories at the beginning of the archive, and include in each
721             directory its contents.  */             directory its contents.  */
722    
723          incremental_option = 1;          incremental_option = true;
724          break;          break;
725    
726        case 'h':        case 'h':
727          /* Follow symbolic links.  */          /* Follow symbolic links.  */
728            dereference_option = true;
         dereference_option = 1;  
729          break;          break;
730    
731        case 'i':        case 'i':
# Line 730  decode_options (int argc, char **argv) Line 733  decode_options (int argc, char **argv)
733             because Unix tar writes two blocks of zeros, then pads out             because Unix tar writes two blocks of zeros, then pads out
734             the record with garbage.  */             the record with garbage.  */
735    
736          ignore_zeros_option = 1;          ignore_zeros_option = true;
737          break;          break;
738    
739        case 'I':        case 'I':
# Line 749  decode_options (int argc, char **argv) Line 752  decode_options (int argc, char **argv)
752          break;          break;
753    
754        case 'K':        case 'K':
755          starting_file_option = 1;          starting_file_option = true;
756          addname (optarg, 0);          addname (optarg, 0);
757          break;          break;
758    
# Line 757  decode_options (int argc, char **argv) Line 760  decode_options (int argc, char **argv)
760          /* When dumping directories, don't dump files/subdirectories          /* When dumping directories, don't dump files/subdirectories
761             that are on other filesystems.  */             that are on other filesystems.  */
762    
763          one_file_system_option = 1;          one_file_system_option = true;
764          break;          break;
765    
766        case 'L':        case 'L':
# Line 767  decode_options (int argc, char **argv) Line 770  decode_options (int argc, char **argv)
770              USAGE_ERROR ((0, 0, "%s: %s", quotearg_colon (optarg),              USAGE_ERROR ((0, 0, "%s: %s", quotearg_colon (optarg),
771                            _("Invalid tape length")));                            _("Invalid tape length")));
772            tape_length_option = 1024 * (tarlong) u;            tape_length_option = 1024 * (tarlong) u;
773            multi_volume_option = 1;            multi_volume_option = true;
774          }          }
775          break;          break;
776    
777        case 'm':        case 'm':
778          touch_option = 1;          touch_option = true;
779          break;          break;
780    
781        case 'M':        case 'M':
782          /* Make multivolume archive: when we can't write any more into          /* Make multivolume archive: when we can't write any more into
783             the archive, re-open it, and continue writing.  */             the archive, re-open it, and continue writing.  */
784    
785          multi_volume_option = 1;          multi_volume_option = true;
786          break;          break;
787    
788  #if !MSDOS  #if !MSDOS
789        case 'N':        case 'N':
790          after_date_option = 1;          after_date_option = true;
791          /* Fall through.  */          /* Fall through.  */
792    
793        case NEWER_MTIME_OPTION:        case NEWER_MTIME_OPTION:
# Line 817  decode_options (int argc, char **argv) Line 820  decode_options (int argc, char **argv)
820  #endif /* not MSDOS */  #endif /* not MSDOS */
821    
822        case 'o':        case 'o':
823          o_option = 1;          o_option = true;
824          break;          break;
825    
826        case 'O':        case 'O':
827          to_stdout_option = 1;          to_stdout_option = true;
828          break;          break;
829    
830        case 'p':        case 'p':
831          same_permissions_option = 1;          same_permissions_option = true;
832          break;          break;
833    
834        case 'P':        case 'P':
835          absolute_names_option = 1;          absolute_names_option = true;
836          break;          break;
837    
838        case 'r':        case 'r':
# Line 844  decode_options (int argc, char **argv) Line 847  decode_options (int argc, char **argv)
847             BSD-derived systems.  This is a consequence of the block/record             BSD-derived systems.  This is a consequence of the block/record
848             terminology confusion.  */             terminology confusion.  */
849    
850          block_number_option = 1;          block_number_option = true;
851          break;          break;
852    
853        case 's':        case 's':
854          /* Names to extr are sorted.  */          /* Names to extr are sorted.  */
855    
856          same_order_option = 1;          same_order_option = true;
857          break;          break;
858    
859        case 'S':        case 'S':
860          sparse_option = 1;          sparse_option = true;
861          break;          break;
862    
863        case 't':        case 't':
# Line 883  decode_options (int argc, char **argv) Line 886  decode_options (int argc, char **argv)
886          break;          break;
887    
888        case 'w':        case 'w':
889          interactive_option = 1;          interactive_option = true;
890          break;          break;
891    
892        case 'W':        case 'W':
893          verify_option = 1;          verify_option = true;
894          break;          break;
895    
896        case 'x':        case 'x':
# Line 923  decode_options (int argc, char **argv) Line 926  decode_options (int argc, char **argv)
926          break;          break;
927    
928        case ATIME_PRESERVE_OPTION:        case ATIME_PRESERVE_OPTION:
929          atime_preserve_option = 1;          atime_preserve_option = true;
930          break;          break;
931    
932        case CHECKPOINT_OPTION:        case CHECKPOINT_OPTION:
933          checkpoint_option = 1;          checkpoint_option = true;
934          break;          break;
935    
936        case BACKUP_OPTION:        case BACKUP_OPTION:
937          backup_option = 1;          backup_option = true;
938          if (optarg)          if (optarg)
939            version_control_string = optarg;            version_control_string = optarg;
940          break;          break;
# Line 945  decode_options (int argc, char **argv) Line 948  decode_options (int argc, char **argv)
948          break;          break;
949    
950        case FORCE_LOCAL_OPTION:        case FORCE_LOCAL_OPTION:
951          force_local_option = 1;          force_local_option = true;
952          break;          break;
953    
954        case FORMAT_OPTION:        case FORMAT_OPTION:
# Line 961  decode_options (int argc, char **argv) Line 964  decode_options (int argc, char **argv)
964          break;          break;
965    
966        case IGNORE_FAILED_READ_OPTION:        case IGNORE_FAILED_READ_OPTION:
967          ignore_failed_read_option = 1;          ignore_failed_read_option = true;
968          break;          break;
969    
970        case GROUP_OPTION:        case GROUP_OPTION:
# Line 1013  decode_options (int argc, char **argv) Line 1016  decode_options (int argc, char **argv)
1016          break;          break;
1017    
1018        case NUMERIC_OWNER_OPTION:        case NUMERIC_OWNER_OPTION:
1019          numeric_owner_option = 1;          numeric_owner_option = true;
1020          break;          break;
1021    
1022        case OVERWRITE_OPTION:        case OVERWRITE_OPTION:
# Line 1039  decode_options (int argc, char **argv) Line 1042  decode_options (int argc, char **argv)
1042          break;          break;
1043    
1044        case PRESERVE_OPTION:        case PRESERVE_OPTION:
1045          same_permissions_option = 1;          same_permissions_option = true;
1046          same_order_option = 1;          same_order_option = true;
1047          break;          break;
1048    
1049        case RECORD_SIZE_OPTION:        case RECORD_SIZE_OPTION:
# Line 1059  decode_options (int argc, char **argv) Line 1062  decode_options (int argc, char **argv)
1062          break;          break;
1063    
1064        case RECURSIVE_UNLINK_OPTION:        case RECURSIVE_UNLINK_OPTION:
1065          recursive_unlink_option = 1;          recursive_unlink_option = true;
1066          break;          break;
1067    
1068        case REMOVE_FILES_OPTION:        case REMOVE_FILES_OPTION:
1069          remove_files_option = 1;          remove_files_option = true;
1070          break;          break;
1071    
1072        case RSH_COMMAND_OPTION:        case RSH_COMMAND_OPTION:
1073          rsh_command_option = optarg;          rsh_command_option = optarg;
1074          break;          break;
1075    
1076          case STRIP_PATH_OPTION:
1077            {
1078              uintmax_t u;
1079              if (! (xstrtoumax (optarg, 0, 10, &u, "") == LONGINT_OK
1080                     && u == (size_t) u))
1081                USAGE_ERROR ((0, 0, "%s: %s", quotearg_colon (optarg),
1082                              _("Invalid number of elements")));
1083              strip_path_elements = u;
1084            }
1085            break;
1086            
1087        case SUFFIX_OPTION:        case SUFFIX_OPTION:
1088          backup_option = 1;          backup_option = true;
1089          backup_suffix_string = optarg;          backup_suffix_string = optarg;
1090          break;          break;
1091    
1092          case TOTALS_OPTION:
1093            totals_option = true;
1094            break;
1095            
1096        case USE_COMPRESS_PROGRAM_OPTION:        case USE_COMPRESS_PROGRAM_OPTION:
1097          set_use_compress_program_option (optarg);          set_use_compress_program_option (optarg);
1098          break;          break;

Legend:
Removed from v.1.64  
changed lines
  Added in v.1.65

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26