From 9222ffea9050a4bec734c0f36c88cefb0adc2dc2 Mon Sep 17 00:00:00 2001 From: Louis Calas Date: Wed, 11 Sep 2019 09:37:12 +0200 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20Help?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NGCC/src/Exec.java | 4 ++-- NGCC/src/commands/Help.java | 16 +++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/NGCC/src/Exec.java b/NGCC/src/Exec.java index 76dd5c4..e03aefd 100644 --- a/NGCC/src/Exec.java +++ b/NGCC/src/Exec.java @@ -32,12 +32,12 @@ public class Exec { CommandLine cmd = new CommandLine(new Evaluate()); cmd.execute(args); - } else if (args[0].contentEquals("--help")) { + } else if (args[0].contentEquals("help") || args[0].contentEquals("--help")) { CommandLine cmd = new CommandLine(new Help()); cmd.execute(args); } else { - System.out.println(args[0] + " : command not found"); + System.err.println("NGCC: "+args[0] + " : command not found"); } diff --git a/NGCC/src/commands/Help.java b/NGCC/src/commands/Help.java index 0b7d962..068ada4 100644 --- a/NGCC/src/commands/Help.java +++ b/NGCC/src/commands/Help.java @@ -14,7 +14,7 @@ import picocli.CommandLine.*; " _______ _________________ ________ \n" + " \\ \\ / _____/\\_ ___ \\\\_ ___ \\ \n" + " / | \\/ \\ ___/ \\ \\// \\ \\/ \n" + - " / | \\ \\_\\ \\ \\___\\ \\__ \n" + + " / | \\ \\_ \\ \\ \\___\\ \\___ \n" + " \\____|__ /\\______ /\\______ /\\______ / \n" + " \\/ \\/ \\/ \\/ \n" + " \n" , @@ -25,16 +25,22 @@ import picocli.CommandLine.*; public class Help implements Callable { - @Option(names= {"--help"}, required = true, arity = "0", order = 1, description = "help") + @Option(names= {"help", "--help"}, required = true, arity = "0", order = 1, description = "help") boolean help; @Override public Void call() throws Exception { if(help) { - System.out.println("Commands List : -b, -r, -g, -p, -a, -e"); - - + System.out.println( + "\nCommands List : \n\n" + + "-b, --build build mode \n" + + "-r, --read read mode \n" + + "-g, --generate generate mode \n" + + "-p, --produce produce mode \n" + + "-a, --analyse analyse mode \n" + + "-e, --evaluate evaluate mode \n" ); + } return null;