Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
60c68e7e
Commit
60c68e7e
authored
Dec 14, 2023
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cli: use the latest version of adopt
parent
18aa18be
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
src/cli/opt.c
+1
-1
src/cli/opt.h
+12
-2
No files found.
src/cli/opt.c
View file @
60c68e7e
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
* This file was produced by using the `rename.pl` script included with
* This file was produced by using the `rename.pl` script included with
* adopt. The command-line specified was:
* adopt. The command-line specified was:
*
*
* ./rename.pl cli_opt --filename=opt --include=c
li
.h --inline=GIT_INLINE --header-guard=CLI_opt_h__ --lowercase-status --without-usage
* ./rename.pl cli_opt --filename=opt --include=c
ommon
.h --inline=GIT_INLINE --header-guard=CLI_opt_h__ --lowercase-status --without-usage
*/
*/
#include <stdlib.h>
#include <stdlib.h>
...
...
src/cli/opt.h
View file @
60c68e7e
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
* This file was produced by using the `rename.pl` script included with
* This file was produced by using the `rename.pl` script included with
* adopt. The command-line specified was:
* adopt. The command-line specified was:
*
*
* ./rename.pl cli_opt --filename=opt --include=c
li
.h --inline=GIT_INLINE --header-guard=CLI_opt_h__ --lowercase-status --without-usage
* ./rename.pl cli_opt --filename=opt --include=c
ommon
.h --inline=GIT_INLINE --header-guard=CLI_opt_h__ --lowercase-status --without-usage
*/
*/
#ifndef CLI_opt_h__
#ifndef CLI_opt_h__
...
@@ -275,7 +275,7 @@ typedef struct cli_opt_parser {
...
@@ -275,7 +275,7 @@ typedef struct cli_opt_parser {
size_t
arg_idx
;
size_t
arg_idx
;
size_t
in_args
;
size_t
in_args
;
size_t
in_short
;
size_t
in_short
;
int
needs_sort
:
1
,
unsigned
int
needs_sort
:
1
,
in_literal
:
1
;
in_literal
:
1
;
}
cli_opt_parser
;
}
cli_opt_parser
;
...
@@ -300,6 +300,16 @@ cli_opt_status_t cli_opt_parse(
...
@@ -300,6 +300,16 @@ cli_opt_status_t cli_opt_parse(
size_t
args_len
,
size_t
args_len
,
unsigned
int
flags
);
unsigned
int
flags
);
/**
* Quickly executes the given callback for each argument.
*
* @param specs A NULL-terminated array of `cli_opt_spec`s that can be parsed
* @param args The arguments that will be parsed
* @param args_len The length of arguments to be parsed
* @param flags The `cli_opt_flag_t flags for parsing
* @param callback The callback to invoke for each specified option
* @param callback_data Data to be provided to the callback
*/
int
cli_opt_foreach
(
int
cli_opt_foreach
(
const
cli_opt_spec
specs
[],
const
cli_opt_spec
specs
[],
char
**
args
,
char
**
args
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment