MCPcopy Create free account
hub / github.com/coreutils/coreutils / main

Function main

src/mv.c:342–573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

340}
341
342int
343main (int argc, char **argv)
344{
345 bool make_backups = false;
346 char const *backup_suffix = NULL;
347 char *version_control_string = NULL;
348 struct cp_options x;
349 bool remove_trailing_slashes = false;
350 char const *target_directory = NULL;
351 bool no_target_directory = false;
352 bool selinux_enabled = (0 < is_selinux_enabled ());
353
354 initialize_main (&argc, &argv);
355 set_program_name (argv[0]);
356 setlocale (LC_ALL, "");
357 bindtextdomain (PACKAGE, LOCALEDIR);
358 textdomain (PACKAGE);
359
360 atexit (close_stdin);
361
362 cp_option_init (&x);
363
364 /* Try to disable the ability to unlink a directory. */
365 priv_set_remove_linkdir ();
366
367 int c;
368 while ((c = getopt_long (argc, argv, "bfint:uvS:TZ", long_options, NULL))
369 != -1)
370 {
371 switch (c)
372 {
373 case 'b':
374 make_backups = true;
375 if (optarg)
376 version_control_string = optarg;
377 break;
378 case 'f':
379 x.interactive = I_ALWAYS_YES;
380 break;
381 case 'i':
382 x.interactive = I_ASK_USER;
383 break;
384 case 'n':
385 x.interactive = I_ALWAYS_SKIP;
386 break;
387 case DEBUG_OPTION:
388 x.debug = x.verbose = true;
389 break;
390 case EXCHANGE_OPTION:
391 x.exchange = true;
392 break;
393 case NO_COPY_OPTION:
394 x.no_copy = true;
395 break;
396 case STRIP_TRAILING_SLASHES_OPTION:
397 remove_trailing_slashes = true;
398 break;
399 case 't':

Callers

nothing calls this directly

Calls 8

target_directory_operandFunction · 0.85
target_dirfd_validFunction · 0.85
hash_initFunction · 0.85
dest_info_initFunction · 0.85
do_moveFunction · 0.85
cp_option_initFunction · 0.70
usageFunction · 0.70
statClass · 0.70

Tested by

no test coverage detected