Commit graph

5322 commits

Author SHA1 Message Date
Ed Page
15d8b3b0cd style: Make clippy happy 2022-04-15 13:49:02 -05:00
Ed Page
2f0d91688a docs(lex): Fix links 2022-04-15 13:08:40 -05:00
Ed Page
530db327db docs(lex): Clarify context-sensitive lexing 2022-04-15 12:49:02 -05:00
Ed Page
687d361a97 docs(lex): Make a determination on to_long_stdio
This tempts me to drop our design philosophy but I want to give it more
time.
2022-04-15 12:46:09 -05:00
Ed Page
e46cf659d6 fix(lex): Provide all dat with ParsedArg::to_value 2022-04-15 12:40:05 -05:00
Ed Page
913ec6d6ec test(lex): Verify behavior directly
While figuring out the API, `clap_lex` was tested by clap's tests.  Now
we are focusing on its API directly.
2022-04-15 12:39:39 -05:00
Ed Page
c3445e05b5 docs(lex): Provide examples 2022-04-15 11:40:49 -05:00
Ed Page
96dc6daa9e feat(lex): Pull out clap_lex 2022-04-15 10:55:37 -05:00
Ed Page
6291289c0f fix(lex): Make long args more convinient 2022-04-15 10:55:34 -05:00
Ed Page
1247a955cf docs(lex): Specify how it all works 2022-04-15 10:55:28 -05:00
Ed Page
6148d681f4 refactor(lex): Clarify side effects 2022-04-15 10:55:25 -05:00
Ed Page
fd16ee9474 refactor(lex): Port to expanded lexer 2022-04-15 10:55:19 -05:00
Ed Page
6e05b8075b refactor(lex): Expand lexer design
In considering the design for this, we want:
- Ability to modify the argment list while maintaining the `Cursor` for
  replacements
- Allow picking up subcommand parsing in the middle of short flags
- Ability to peek at the next item to determine if we want to treat it
  as a flag or as a value
- Ability to detect started short and long arguments for completions

Longer term, we also want to consider:
- Allowing users to customize the lexer to support different syntaxes
2022-04-15 10:55:12 -05:00
Ed Page
c58928b6bd refactor(lex): Track replacements as str
The lexer will soon return `RawOsStr` and it'll cost to turn that into
an `OsStr`.  However, it caches a `str`, so let's just use that.
2022-04-15 10:55:08 -05:00
Ed Page
f66d8abebd refactor(lex): Experiment with an alt 'previous'
Since we'll need `skip`, it made me wonder how to name `skip` and
`previous` to fit together, so I decided to play with `seek`.  Its
probably over kill but wondering if its better.
2022-04-15 10:55:05 -05:00
Ed Page
3ebf61e28d refactor(lex): Narrow focus for lexer
Before, we had a generic `next` that provided the next item and peeked
at all remaining items.  This was to work around the borrow checker for
modifying the position while accessing args.

We've now split `Input` into `RawArgs` and `ArgsCursor` so we don't have
overlapping borrows.  This made it so we can split `next` into `next`,
`peek`, and `remaining`.
2022-04-15 10:55:00 -05:00
Ed Page
0000d506ed refactor(lex): Remove unused bound 2022-04-15 10:54:50 -05:00
Ed Page
65120784f5 refactor(lex): Split out input cursor 2022-04-15 10:54:43 -05:00
naveensrinivasan
45c8b67cdb
Set permissions for GitHub actions
- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

 Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2022-04-15 14:51:52 +00:00
Ed Page
b1003a1c54
Merge pull request #3624 from Chloe-Woahie/master
Fixed documentation typos
2022-04-11 07:06:55 -05:00
Chloe-Woahie
87c87565af docs: Fixed documentation typos 2022-04-10 12:43:09 -04:00
Ed Page
b73b7efa5c
Merge pull request #3617 from rhysd/patch-2
docs: Remove unnecessary backtick in changelog
2022-04-08 07:07:11 -05:00
Linda_pp
4626523ca6
docs: Remove unnecessary backtick in changelog 2022-04-08 13:23:24 +09:00
Ed Page
858f184428
Merge pull request #3587 from ducaale/value-name-as-header-positional
Use `Arg::value_name()` as header for positionals in clap_mangen
2022-04-04 09:56:41 -05:00
Ed Page
871792ee3f
Merge pull request #3609 from epage/index
docs: Don't encourage index
2022-04-04 09:52:51 -05:00
Ed Page
a3b628998d docs: Don't encourage index
Its extra maintenance and more likely to cause annoyances.

Fixes #3608
2022-04-04 08:52:20 -05:00
ducaale
fbfeaabfd1 fix(clap_mangen): Use italic for replaceble args 2022-04-03 13:35:30 +01:00
Ed Page
e91d18ba0e
Merge pull request #3605 from ducaale/synopsis-hidden-flags
Don't include hidden flags in the synopsis section from clap_mangen
2022-04-02 19:59:50 -05:00
ducaale
ddc83bfdc8 test(clap_mangen): Hidden flags in synopsis 2022-04-03 00:28:31 +01:00
ducaale
b3b49855ab fix(clap_mangen): Hide hidden flags in synopsis 2022-04-03 00:11:45 +01:00
ducaale
99d6737521 fix(clap_mangen): Update snapshot tests 2022-04-03 00:03:02 +01:00
Ed Page
5be61a199c docs(examples); Call out optional subcommands 2022-04-01 09:27:29 -05:00
Ed Page
08f74046dc chore: Release 2022-04-01 09:15:32 -05:00
Ed Page
6aa40ad2cb docs: Update changelog 2022-04-01 09:15:18 -05:00
Ed Page
732830a98c
Merge pull request #3598 from dragonrider7225/bring-back-debug-impls
fix: Bring forward Debug impls from v2
2022-04-01 09:14:42 -05:00
Kevin Moonen
17fed36da3 fix: Bring forward Debug impls from v2 2022-03-31 22:45:37 -05:00
Ed Page
c75d2642ef chore: Release 2022-03-31 12:22:40 -05:00
Ed Page
b774370565 docs: Update changelog 2022-03-31 12:22:13 -05:00
Ed Page
71ef8878c5
Merge pull request #3591 from Shir0kamii/fix-ArgEnum-non-unit
Fix ArgEnum non-unit variant
2022-03-31 12:18:19 -05:00
shir0kamii
fb4755d1c3 feat(derive): Don't abort when non-unit variant is skipped 2022-03-31 18:49:21 +02:00
shir0kamii
ee3d12ec56 fix(derive): Abort on non-unit variant 2022-03-30 03:49:14 +02:00
ducaale
fbd33891b4 fix(clap_mangen): Use value_names for positionals 2022-03-28 21:22:18 +01:00
Ed Page
06f855f2ab
Merge pull request #3582 from ducaale/fix-docs
Fix doc comments for Man::section() in `clap_mangen`
2022-03-26 12:57:25 -05:00
ducaale
d55e46f65f docs(mangen): Fix docs for Man::section() 2022-03-26 17:49:34 +00:00
Ed Page
731d18f300 docs(examples): Fix help output 2022-03-25 07:20:46 -05:00
Ed Page
6835dfa978
Merge pull request #3577 from samueltardieu/fix-arg-help-doc
docs: arg! macro uses double quotes for help string
2022-03-25 07:07:05 -05:00
Samuel Tardieu
ef3c2c73d5 docs: arg! macro uses double quotes for help string 2022-03-25 11:00:47 +01:00
Ed Page
edf75cc772
Merge pull request #3571 from epage/fixes
docs: Fix examples
2022-03-23 12:42:05 -05:00
Ed Page
4161b16f2b chore(ci): Run on documentation changes 2022-03-23 12:37:19 -05:00
Ed Page
429e1d3f31 docs: Fix examples
CI didn't run for #3570, so we missed that some things were off on
Windows.
2022-03-23 12:31:13 -05:00