summaryrefslogtreecommitdiff
path: root/examples/remote.c
diff options
context:
space:
mode:
authorEtienne Samson <samson.etienne@gmail.com>2019-11-06 11:08:49 +0100
committerEtienne Samson <samson.etienne@gmail.com>2019-11-06 11:17:56 +0100
commit313908f9f5322f623ef1924f859726b39cb9740c (patch)
tree599dabe529ddda13e447366a7552ba74b0941d42 /examples/remote.c
parent4a4ad2bc8374db6e82464a6f066840430b6657ec (diff)
downloadlibgit2-313908f9f5322f623ef1924f859726b39cb9740c.tar.gz
examples: normalize decls and usage of options structs
Diffstat (limited to 'examples/remote.c')
-rw-r--r--examples/remote.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/examples/remote.c b/examples/remote.c
index 7345f82de..34d886526 100644
--- a/examples/remote.c
+++ b/examples/remote.c
@@ -30,7 +30,7 @@ enum subcmd {
subcmd_show,
};
-struct opts {
+struct remote_opts {
enum subcmd cmd;
/* for command-specific args */
@@ -38,20 +38,20 @@ struct opts {
char **argv;
};
-static int cmd_add(git_repository *repo, struct opts *o);
-static int cmd_remove(git_repository *repo, struct opts *o);
-static int cmd_rename(git_repository *repo, struct opts *o);
-static int cmd_seturl(git_repository *repo, struct opts *o);
-static int cmd_show(git_repository *repo, struct opts *o);
+static int cmd_add(git_repository *repo, struct remote_opts *o);
+static int cmd_remove(git_repository *repo, struct remote_opts *o);
+static int cmd_rename(git_repository *repo, struct remote_opts *o);
+static int cmd_seturl(git_repository *repo, struct remote_opts *o);
+static int cmd_show(git_repository *repo, struct remote_opts *o);
static void parse_subcmd(
- struct opts *opt, int argc, char **argv);
+ struct remote_opts *opt, int argc, char **argv);
static void usage(const char *msg, const char *arg);
int lg2_remote(git_repository *repo, int argc, char *argv[])
{
int retval = 0;
- struct opts opt = {0};
+ struct remote_opts opt = {0};
parse_subcmd(&opt, argc, argv);
@@ -77,7 +77,7 @@ int lg2_remote(git_repository *repo, int argc, char *argv[])
return retval;
}
-static int cmd_add(git_repository *repo, struct opts *o)
+static int cmd_add(git_repository *repo, struct remote_opts *o)
{
char *name, *url;
git_remote *remote = {0};
@@ -94,7 +94,7 @@ static int cmd_add(git_repository *repo, struct opts *o)
return 0;
}
-static int cmd_remove(git_repository *repo, struct opts *o)
+static int cmd_remove(git_repository *repo, struct remote_opts *o)
{
char *name;
@@ -109,7 +109,7 @@ static int cmd_remove(git_repository *repo, struct opts *o)
return 0;
}
-static int cmd_rename(git_repository *repo, struct opts *o)
+static int cmd_rename(git_repository *repo, struct remote_opts *o)
{
int i, retval;
char *old, *new;
@@ -134,7 +134,7 @@ static int cmd_rename(git_repository *repo, struct opts *o)
return retval;
}
-static int cmd_seturl(git_repository *repo, struct opts *o)
+static int cmd_seturl(git_repository *repo, struct remote_opts *o)
{
int i, retval, push = 0;
char *name = NULL, *url = NULL;
@@ -166,7 +166,7 @@ static int cmd_seturl(git_repository *repo, struct opts *o)
return 0;
}
-static int cmd_show(git_repository *repo, struct opts *o)
+static int cmd_show(git_repository *repo, struct remote_opts *o)
{
int i;
const char *arg, *name, *fetch, *push;
@@ -213,7 +213,7 @@ static int cmd_show(git_repository *repo, struct opts *o)
}
static void parse_subcmd(
- struct opts *opt, int argc, char **argv)
+ struct remote_opts *opt, int argc, char **argv)
{
char *arg = argv[1];
enum subcmd cmd = 0;