Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cp: move help strings to markdown file #4372

Merged
merged 3 commits into from
Feb 16, 2023

Conversation

papparapa
Copy link
Contributor

#4368

After this PR, cp -h gives the following output.

$ ./target/debug/coreutils cp -h
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.

Usage: ./target/debug/coreutils cp [OPTION]... [-T] SOURCE DEST
./target/debug/coreutils cp [OPTION]... SOURCE... DIRECTORY
./target/debug/coreutils cp [OPTION]... -t DIRECTORY SOURCE...


Arguments:
  [paths]...  

Options:
  -t, --target-directory <target-directory>  copy all SOURCE arguments into target-directory
  -T, --no-target-directory                  Treat DEST as a regular file and not a directory
  -i, --interactive                          ask before overwriting files
  -l, --link                                 hard-link files instead of copying
  -n, --no-clobber                           don't overwrite a file that already exists
  -r, --recursive                            copy directories recursively [short aliases: R]
      --strip-trailing-slashes               remove any trailing slashes from each SOURCE argument
  -v, --verbose                              explicitly state what is being done
  -s, --symbolic-link                        make symbolic links instead of copying
  -f, --force                                if an existing destination file cannot be opened, remove it and try again (this option is ignored when the -n
                                             option is also used). Currently not implemented for Windows.
      --remove-destination                   remove each existing destination file before attempting to open it (contrast with --force). On Windows, currently
                                             only works for writeable files.
      --backup[=<CONTROL>]                   make a backup of each existing destination file
  -b                                         like --backup but does not accept an argument
  -S, --suffix <SUFFIX>                      override the usual backup suffix
  -u, --update                               copy only when the SOURCE file is newer than the destination file or when the destination file is missing
      --reflink[=<WHEN>]                     control clone/CoW copies. See below [possible values: auto, always, never]
      --attributes-only                      Don't copy the file data, just the attributes
      --preserve [<ATTR_LIST>...]            Preserve the specified attributes (default: mode, ownership (unix only), timestamps), if possible additional
                                             attributes: context, links, xattr, all [possible values: mode, ownership, timestamps, context, links, xattr, all]
  -p, --preserve-default-attributes          same as --preserve=mode,ownership(unix only),timestamps
      --no-preserve <ATTR_LIST>              don't preserve the specified attributes
      --parents                              use full source file name under DIRECTORY
  -P, --no-dereference                       never follow symbolic links in SOURCE
  -L, --dereference                          always follow symbolic links in SOURCE
  -H                                         follow command-line symbolic links in SOURCE
  -a, --archive                              Same as -dR --preserve=all
  -d                                         same as --no-dereference --preserve=links
  -x, --one-file-system                      stay on this file system
      --sparse <WHEN>                        control creation of sparse files. See below [possible values: never, auto, always]
      --copy-contents                        NotImplemented: copy contents of special files when recursive
      --context <CTX>                        NotImplemented: set SELinux security context of destination file to default type
  -g, --progress                             Display a progress bar. 
                                             Note: this feature is not supported by GNU coreutils.
  -h, --help                                 Print help information
  -V, --version                              Print version information

The backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.
The version control method may be selected via the --backup option or through
the VERSION_CONTROL environment variable.  Here are the values:

  none, off       never make backups (even if --backup is given)
  numbered, t     make numbered backups
  existing, nil   numbered if numbered backups exist, simple otherwise
  simple, never   always make simple backups

@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/misc/timeout is no longer failing!
Congrats! The gnu test tests/tail-2/inotify-dir-recreate is no longer failing!

Copy link
Member

@tertsdiepraam tertsdiepraam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Just one small suggestion.

Comment on lines +7 to +12
## Usage
```
cp [OPTION]... [-T] SOURCE DEST
cp [OPTION]... SOURCE... DIRECTORY
cp [OPTION]... -t DIRECTORY SOURCE...
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, but could you move this above the ## About for consistency? See the discussion in #4368 for context.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed the discussion.
Now fixed.

@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/tail-2/inotify-dir-recreate is no longer failing!

Copy link
Member

@tertsdiepraam tertsdiepraam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tertsdiepraam tertsdiepraam merged commit 34e31f2 into uutils:main Feb 16, 2023
@papparapa papparapa deleted the cp-move-help-strings-to-md-file branch February 16, 2023 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants