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

Check args and flags for commands #117

Open
JinnyYi opened this issue Nov 18, 2021 · 0 comments
Open

Check args and flags for commands #117

JinnyYi opened this issue Nov 18, 2021 · 0 comments

Comments

@JinnyYi
Copy link
Contributor

JinnyYi commented Nov 18, 2021

Before executing the command, it may be necessary to check args and flags. If there are illegal arguments, an error should be returned directly.

Include but not limit to the following possible checks:

  • cat, sign, tee
    • if src is a dir, cat (sign, tee): src: Is a directory should return
  • cp and move
    • if src is a dir, --recursive option is required
    • if there are multiple srcs, dst should be a directory
    • if src == dst, cp: 'src' and 'dst' are the same error should return (similarly, Dir(src) == dst)
    • if dst is the subdirectory of src, maybe we should reject?
  • rm
    • if src is a dir, --recursive option is required
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

No branches or pull requests

1 participant