Skip to content

[MISC] Add quotes to strings#224

Merged
eseiler merged 3 commits intoseqan:mainfrom
eseiler:misc/quotes
Feb 7, 2024
Merged

[MISC] Add quotes to strings#224
eseiler merged 3 commits intoseqan:mainfrom
eseiler:misc/quotes

Conversation

@eseiler
Copy link
Copy Markdown
Member

@eseiler eseiler commented Feb 2, 2024

See #222

To-do

  • Adapt CTD/CWL
  • Add API patches

Test output on terminal

POSITIONAL ARGUMENTS
    ARGUMENT-1 (List of std::string)
          Default: ["Some", "other", "string"]

OPTIONS
    -a, --string1 (std::string)
          Default: ""
    -b, --string2 (std::string)
          Default: "Some string"
    -c, --string3 (std::string)
          Default: "Quoted"
    -d, --string4 (List of std::string)
          Default: ["Some", "other", "string"]
    -e, --string5 (List of std::string)
          Default: None
POSITIONAL ARGUMENTS
    ARGUMENT-1 (List of std::filesystem::path)
          Default: ["/some", "/other", "/path"]

OPTIONS
    -a, --path1 (std::filesystem::path)
          Default: ""
    -b, --path2 (std::filesystem::path)
          Default: "/some/path"
    -c, --path3 (std::filesystem::path)
          Default: "/usr/bin/"
    -d, --path4 (List of std::filesystem::path)
          Default: ["/some", "/other", "/path"]
    -e, --path5 (List of std::filesystem::path)
          Default: None

Questions

  • Do we also want to get rid of the . at the end? (If there is a validator message, it will take care of prepending . )
  • std::quoted also escapes quote inside strings. Do we want that?
  • Should we also quote filepaths?

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
sharg-parser ✅ Ready (Inspect) Visit Preview Feb 5, 2024 6:13pm

@seqan-actions seqan-actions added lint [INTERNAL] signals that clang-format ran and removed lint [INTERNAL] signals that clang-format ran labels Feb 2, 2024
@seqan-actions seqan-actions added lint [INTERNAL] signals that clang-format ran and removed lint [INTERNAL] signals that clang-format ran labels Feb 4, 2024
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 4, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (fb9552d) 91.91% compared to head (f1a2163) 91.90%.

❗ Current head f1a2163 differs from pull request most recent head 19a3e9b. Consider uploading reports for the commit 19a3e9b to get more accurate results

Files Patch % Lines
include/sharg/detail/format_tdl.hpp 85.71% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #224      +/-   ##
==========================================
- Coverage   91.91%   91.90%   -0.01%     
==========================================
  Files          17       17              
  Lines        1595     1618      +23     
==========================================
+ Hits         1466     1487      +21     
- Misses        129      131       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SGSSGene
Copy link
Copy Markdown
Contributor

SGSSGene commented Feb 5, 2024

My answers to all three questions:

  • yes
  • yes
  • yes

@seqan-actions seqan-actions added lint [INTERNAL] signals that clang-format ran and removed lint [INTERNAL] signals that clang-format ran labels Feb 5, 2024
@seqan-actions seqan-actions added lint [INTERNAL] signals that clang-format ran and removed lint [INTERNAL] signals that clang-format ran labels Feb 5, 2024
@seqan-actions seqan-actions added the lint [INTERNAL] signals that clang-format ran label Feb 5, 2024
@seqan-actions seqan-actions removed the lint [INTERNAL] signals that clang-format ran label Feb 5, 2024
@seqan-actions seqan-actions added lint [INTERNAL] signals that clang-format ran and removed lint [INTERNAL] signals that clang-format ran labels Feb 5, 2024
@h-2
Copy link
Copy Markdown
Member

h-2 commented Feb 5, 2024

As far as I am concerned, you can get rid of the dot! But I would still wrap strings (and paths!) in quotes, because the user needs to be able to distinguish " " and "" (or "foo " and "foo").
If you are concerned that this will cause ambiguity with literal quotes, you could choose more exotic quotes, like the ones used for code in markdown (`) or the french ones: »foo«

@seqan-actions seqan-actions added lint [INTERNAL] signals that clang-format ran and removed lint [INTERNAL] signals that clang-format ran labels Feb 5, 2024
@seqan-actions seqan-actions added lint [INTERNAL] signals that clang-format ran and removed lint [INTERNAL] signals that clang-format ran labels Feb 5, 2024
@seqan-actions seqan-actions added lint [INTERNAL] signals that clang-format ran and removed lint [INTERNAL] signals that clang-format ran labels Feb 5, 2024
Copy link
Copy Markdown
Contributor

@SGSSGene SGSSGene left a comment

Choose a reason for hiding this comment

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

Thank you!

@eseiler eseiler merged commit 0ef21e2 into seqan:main Feb 7, 2024
@eseiler eseiler deleted the misc/quotes branch February 7, 2024 11:01
@h-2
Copy link
Copy Markdown
Member

h-2 commented Feb 8, 2024

Thanks ❤️

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.

4 participants