This makes ncftool set the (undocumented) NETCF_DEBUG variable
for us.
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
src/ncftool.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/ncftool.c b/src/ncftool.c
index 66c590c..96276e9 100644
--- a/src/ncftool.c
+++ b/src/ncftool.c
@@ -663,6 +663,8 @@ static void usage(void) {
fprintf(stderr, "\nOptions:\n\n");
fprintf(stderr,
" -r, --root ROOT use ROOT as the root of the
filesystem\n\n");
+ fprintf(stderr,
+ " -d, --debug Show debugging output\n\n");
print_all_cmds(stderr);
exit(EXIT_FAILURE);
@@ -673,12 +675,16 @@ static void parse_opts(int argc, char **argv) {
struct option options[] = {
{ "help", 0, 0, 'h' },
{ "root", 1, 0, 'r' },
+ { "debug", 0, 0, 'd' },
{ 0, 0, 0, 0}
};
int idx;
- while ((opt = getopt_long(argc, argv, "+hr:", options, &idx)) != -1) {
+ while ((opt = getopt_long(argc, argv, "+dhr:", options, &idx)) != -1)
{
switch(opt) {
+ case 'd':
+ setenv("NETCF_DEBUG", "1", 1);
+ break;
case 'h':
usage();
break;
--
1.6.5.2
Show replies by date
On Sat, 2010-01-30 at 19:59 -0500, Cole Robinson wrote:
This makes ncftool set the (undocumented) NETCF_DEBUG variable
for us.
ACK. Much better than some obscure env variable.
I've just pushed 1/3 and 3/3 (after rebase) Thanks for these, they are
much needed.
David