Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
6f296810
Commit
6f296810
authored
21 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Add support for new option -V or --version.
parent
ed6358e3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/squeue/opts.c
+13
-0
13 additions, 0 deletions
src/squeue/opts.c
with
13 additions
and
0 deletions
src/squeue/opts.c
+
13
−
0
View file @
6f296810
...
@@ -50,6 +50,7 @@
...
@@ -50,6 +50,7 @@
#define OPT_LONG 0x0c
#define OPT_LONG 0x0c
#define OPT_SORT 0x0d
#define OPT_SORT 0x0d
#define OPT_NO_HEAD 0x0e
#define OPT_NO_HEAD 0x0e
#define OPT_VERSION 0x0f
/* FUNCTIONS */
/* FUNCTIONS */
static
List
_build_job_list
(
char
*
str
);
static
List
_build_job_list
(
char
*
str
);
...
@@ -63,6 +64,7 @@ static int _parse_state( char* str, enum job_states* states );
...
@@ -63,6 +64,7 @@ static int _parse_state( char* str, enum job_states* states );
static
void
_parse_token
(
char
*
token
,
char
*
field
,
int
*
field_size
,
static
void
_parse_token
(
char
*
token
,
char
*
field
,
int
*
field_size
,
bool
*
right_justify
,
char
**
suffix
);
bool
*
right_justify
,
char
**
suffix
);
static
void
_print_options
(
void
);
static
void
_print_options
(
void
);
static
void
_print_version
(
void
);
/*
/*
* parse_command_line
* parse_command_line
...
@@ -112,6 +114,8 @@ parse_command_line( int argc, char* argv[] )
...
@@ -112,6 +114,8 @@ parse_command_line( int argc, char* argv[] )
"comma separated list of users to view"
,
"user_name"
},
"comma separated list of users to view"
,
"user_name"
},
{
"verbose"
,
'v'
,
POPT_ARG_NONE
,
&
params
.
verbose
,
OPT_VERBOSE
,
{
"verbose"
,
'v'
,
POPT_ARG_NONE
,
&
params
.
verbose
,
OPT_VERBOSE
,
"verbosity level"
,
NULL
},
"verbosity level"
,
NULL
},
{
"version"
,
'V'
,
POPT_ARG_NONE
,
0
,
OPT_VERSION
,
"output version information and exit"
,
NULL
},
POPT_AUTOHELP
POPT_AUTOHELP
{
NULL
,
'\0'
,
0
,
NULL
,
0
,
NULL
,
NULL
}
/* end the list */
{
NULL
,
'\0'
,
0
,
NULL
,
0
,
NULL
,
NULL
}
/* end the list */
};
};
...
@@ -155,6 +159,10 @@ parse_command_line( int argc, char* argv[] )
...
@@ -155,6 +159,10 @@ parse_command_line( int argc, char* argv[] )
case
OPT_VERBOSE
:
case
OPT_VERBOSE
:
params
.
verbose
=
true
;
params
.
verbose
=
true
;
break
;
break
;
case
OPT_VERSION
:
_print_version
();
exit
(
0
);
break
;
default:
default:
break
;
break
;
}
}
...
@@ -820,3 +828,8 @@ _build_user_list( char* str )
...
@@ -820,3 +828,8 @@ _build_user_list( char* str )
return
my_list
;
return
my_list
;
}
}
static
void
_print_version
(
void
)
{
printf
(
"%s %s
\n
"
,
PACKAGE
,
SLURM_VERSION
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment