aboutsummaryrefslogtreecommitdiff
path: root/0.8.0/src/adjutrix/command_line.cc
blob: c0b5c9180b5b630fb0b97d531a50674aae377c41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/* vim: set sw=4 sts=4 et foldmethod=syntax : */

/*
 * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
 *
 * This file is part of the Paludis package manager. Paludis is free software;
 * you can redistribute it and/or modify it under the terms of the GNU General
 * Public License version 2, as published by the Free Software Foundation.
 *
 * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place, Suite 330, Boston, MA  02111-1307  USA
 */

#include "command_line.hh"

CommandLine::CommandLine() :
    ArgsHandler(),

    tree_action_args(this, "Tree-Oriented Actions",
            "Selects which basic tree-oriented action to perform. Exactly one action should "
            "be specified."),

    a_find_stable_candidates(&tree_action_args,
            "find-stable-candidates", 's',  "Search for stable package candidates"),
    a_find_dropped_keywords(&tree_action_args,
            "find-dropped-keywords",  'd',  "Search for packages where keywords have been dropped"),
    a_find_insecure_packages(&tree_action_args,
            "find-insecure-packages",  'i',  "Search for packages marked as insecure by a GLSA"),
    a_keywords_graph(&tree_action_args,
            "keyword-graph",          'k',  "Display keywords graphically"),
    a_reverse_deps(&tree_action_args,
            "reverse-deps",           'r',  "Find all package that depend on a given dep atom"),

    profile_action_args(this, "Profile-Oriented Actions",
            "Selects which basic profile-oriented action to perform. Exactly one action should "
            "be specified."),

    a_display_profiles_use(&profile_action_args,
            "display-profiles-use",   'u',  "Display USE information for all profiles"),
    a_display_default_system_resolution(&profile_action_args,
            "display-default-system-resolution", 'S', "Display package names and versions that are included in "
            "the default resolution of the system set"),

    general_action_args(this, "General Actions",
            "Selects which basic general action to perform. Exactly one action should "
            "be specified."),

    a_version(&general_action_args,
            "version",                'V',  "Display program version"),
    a_help(&general_action_args,
            "help",                   'h',  "Display program help"),

    general_args(this, "General options",
            "Options which are relevant for most or all actions."),
    a_log_level(&general_args, "log-level",  '\0', "Specify the log level",
            paludis::args::EnumArg::EnumArgOptions("debug", "Show debug output (noisy)")
            ("qa",      "Show QA messages and warnings only")
            ("warning", "Show warnings only")
            ("silent",  "Suppress all log messages"),
            "qa"),
    a_no_colour(&general_args, "no-colour", '\0', "Do not use colour"),
    a_no_color(&a_no_colour, "no-color"),

    a_repository_directory(&general_args, "repository-dir", 'D',
            "Where to find the repository (default: detected from ./ or ../ or ../..)"),

    tree_args(this, "Tree action options",
            "Options which are relevant for tree actions."),
    a_category(&tree_args,   "category",   'C',
            "Matches with this category name only (may be specified multiple times)"),
    a_package(&tree_args,    "package",    'P',
            "Matches with this package name only (may be specified multiple times)"),

    profile_args(this, "Profile action options",
            "Options which are relevant for profile actions."),
    a_profile(&profile_args,    "profile",    'p',
            "Display results for this profile path, rather than all profiles (may be specified multiple times)"),
    a_unstable(&profile_args,   "unstable",    'U',
            "Accept ~arch as well as arch")
{
    add_usage_line("--find-stable-candidates arch [ --repository-dir /path ] "
            "[ --category app-misc --category sys-apps ... ] "
            "[ --package foo --package fnord ... ] ");
    add_usage_line("--find-dropped-keywords arch [ --repository-dir /path ] "
            "[ --category app-misc --category sys-apps ... ] "
            "[ --package foo --package fnord ... ] ");
    add_usage_line("--find-insecure-packages [ --repository-dir /path ] "
            "[ --category app-misc --category sys-apps ... ] "
            "[ --package foo --package fnord ... ] ");
    add_usage_line("--keywords-graph [ --repository-dir /path ] "
            "[ --category app-misc --category sys-apps ... ] "
            "[ --package foo --package fnord ... ]");
    add_usage_line("--display-profiles-use [ --profile default-linux/x86/2006.0 "
            "--profile default-linux/x86/2006.1 ... ] [ --repository-dir /path ]");

    add_usage_line("--version");
    add_usage_line("--help");

    add_enviromnent_variable("PALUDIS_EBUILD_DIR", "Where to look for ebuild.bash and related "
            "utilities.");
    add_enviromnent_variable("PALUDIS_REPOSITORY_SO_DIR", "Where to look for repository .so "
            "files.");
}

std::string
CommandLine::app_name() const
{
    return "adjutrix";
}

std::string
CommandLine::app_synopsis() const
{
    return "A tool for arch teams";
}

std::string
CommandLine::app_description() const
{
    return
        "adjutrix provides a number of utilities that may be useful for arch teams."
        "\n\n"
        "The --repository-dir switch can be used to tell adjutrix where to find "
        "the repository. If this switch is not used, adjutrix will check the current "
        "directory, the parent directory and the parent's parent directory for "
        "something resembling a profile root. If run inside a package or category "
        "directory, filtering in the style of --package and --category is carried "
        "out automatically for the current package or category.";
}

CommandLine::~CommandLine()
{
}