View Javadoc
1   package fr.ifremer.quadrige3.core.action;
2   
3   /*-
4    * #%L
5    * Quadrige3 Core :: Quadrige3 Client Core
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2017 Ifremer
10   * %%
11   * This program is free software: you can redistribute it and/or modify
12   * it under the terms of the GNU Affero General Public License as published by
13   * the Free Software Foundation, either version 3 of the License, or
14   * (at your option) any later version.
15   *
16   * This program is distributed in the hope that it will be useful,
17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   * GNU General Public License for more details.
20   *
21   * You should have received a copy of the GNU Affero General Public License
22   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23   * #L%
24   */
25  
26  /**
27   * <p>
28   * HelpAction class.
29   * </p>
30   */
31  public class HelpAction {
32  
33      private static String LS = System.lineSeparator();
34  
35      /**
36       * <p>
37       * show.
38       * </p>
39       */
40      public void show() {
41          StringBuilder sb = new StringBuilder();
42  
43          sb.append("Usage:  <commands> <options>").append(LS)
44                  .append("with <commands>:").append(LS)
45                  .append(" -h --help                                  Display help").append(LS)
46                  .append("    --schema-update                         Run database schema update").append(LS)
47                  .append("    --schema-status    --output <file>      Generate a database status report (pending schema changes)").append(LS)
48                  .append("    --schema-diff      --output <file>      Generate a database schema diff report (compare database to quadrige3 data model)").append(LS)
49                  .append("    --schema-changelog --output <file>      Generate a diff into a changelog XML file (compare database to quadrige3 data model)").append(LS)
50                  .append("    --new-db           --output <directory> Generate a empty Quadrige3 database (and execute --schema-update)").append(LS)
51                  .append("    --import-ref                            Import referential data, from the central database").append(LS)
52                  .append("    --import-data                           Import raw data, from the central database").append(LS)
53                  .append(LS)
54                  .append("with <options>:").append(LS)
55                  .append(" -u --user <user>		           Database user").append(LS)
56                  .append(" -p --password <pwd> 		       Database password").append(LS)
57                  .append(" -db --database <db_url> 	       Database JDBC URL ()").append(LS)
58                  .append(" -f                               Force the output directory overwrite, if exists").append(LS)
59                  .append(LS)
60                  .append("other <options> for commands --import-XXX").append(LS)
61                  .append(" -iu  --import-user <user>        Imported database user").append(LS)
62                  .append(" -ip  --import-password <pwd>     Imported database password").append(LS)
63                  .append(" -idb --import-database <db_url>  Imported database JDBC URL").append(LS)
64                  .append(" -ny  --nb-years <nb_years>       Number of years to import (for --import-data)").append(LS)
65          ;
66  
67          System.out.println(sb.toString());
68      }
69  }