aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-23 22:32:43 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-23 22:32:43 +0100
commitaf8ccba94d959a4c5b27278a1ff4d9a81fc056af (patch)
tree75dc65117ce815bff832e02d74d3591acfbf25a5
parentall of the commands (diff)
downloadsat-af8ccba94d959a4c5b27278a1ff4d9a81fc056af.tar.gz
sat-af8ccba94d959a4c5b27278a1ff4d9a81fc056af.tar.bz2
sat-af8ccba94d959a4c5b27278a1ff4d9a81fc056af.tar.xz
satq and satr does not take any arguments
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
-rw-r--r--src/satq.c27
-rw-r--r--src/satr.c25
2 files changed, 52 insertions, 0 deletions
diff --git a/src/satq.c b/src/satq.c
index fa5146f..3d87d1c 100644
--- a/src/satq.c
+++ b/src/satq.c
@@ -19,12 +19,39 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
+#include <stdio.h>
+#include <stdlib.h>
+/**
+ * The name of the process.
+ */
+char *argv0 = "satq";
+
+
+
+/**
+ * Print usage information.
+ */
+static void
+usage(void)
+{
+ fprintf(stderr, "usage: %s\n",
+ strrchr(argv0) ? (strrchr(argv0) + 1) : argv0);
+ exit(2);
+}
+
+
int
main(int argc, char *argv[])
{
+ if (argc > 1) {
+ usage();
+ } else if (argc == 1) {
+ argv0 = argv[0];
+ }
+
/* TODO print the job queue */
}
diff --git a/src/satr.c b/src/satr.c
index ab2475b..1d6c1ce 100644
--- a/src/satr.c
+++ b/src/satr.c
@@ -22,9 +22,34 @@
+/**
+ * The name of the process.
+ */
+char *argv0 = "satr";
+
+
+
+/**
+ * Print usage information.
+ */
+static void
+usage(void)
+{
+ fprintf(stderr, "usage: %s\n",
+ strrchr(argv0) ? (strrchr(argv0) + 1) : argv0);
+ exit(2);
+}
+
+
int
main(int argc, char *argv[])
{
+ if (argc > 1) {
+ usage();
+ } else if (argc == 1) {
+ argv0 = argv[0];
+ }
+
/* TODO tell the daemon to start running jobs even if it is not time yet. */
}