我试图理解详细标志是如何工作的但失败了。手册页和资质参考指南。
唯一的帮助用法是在https://www.debian.org/doc/manuals/aptitude/ch02s05s05.en.html#configCmdLine-Verbose:
选项:
Aptitude::CmdLine::Verbose
默认:0
描述: 这控制命令行模式的详细程度资质是。每次出现该-v
命令行选项都会将该值加 1。
但它并没有告诉我们这个工作的范围。它也不会告诉你是否使用
~$ cat ~/.aptitude/config
Verbose "2";
那么做到底是aptitude -v
无用还是无用呢?
答案1
正如 Jeff Schaller 所说,回答你的问题的最好方法是查看源代码。您可以通过以下方式获取最新版本:
git clone https://anonscm.debian.org/cgit/aptitude/aptitude.git
然后查看verbose
字符串的出现情况。
cd aptitude/src
grep -R verbose *
您将获得以下输出:
cmdline/cmdline_action.cc: int verbose,
cmdline/cmdline_action.cc: verbose,
cmdline/cmdline_action.cc: verbose,
cmdline/cmdline_action.cc: int verbose,
cmdline/cmdline_action.cc: if(verbose>0)
cmdline/cmdline_action.cc: if(verbose>0)
cmdline/cmdline_action.cc: if (verbose > 0)
cmdline/cmdline_action.cc: if (verbose > 0)
cmdline/cmdline_action.cc: if (verbose > 0)
cmdline/cmdline_action.cc: if (verbose > 0)
cmdline/cmdline_action.cc: if (verbose > 0)
cmdline/cmdline_action.cc: if (verbose > 0)
cmdline/cmdline_action.cc: if (verbose > 0)
cmdline/cmdline_action.cc: verbose,
cmdline/cmdline_action.cc: int verbose,
cmdline/cmdline_action.cc: verbose, source,
cmdline/cmdline_action.cc: verbose,
cmdline/cmdline_action.cc: verbose, source,
cmdline/cmdline_action.cc: verbose, source,
cmdline/cmdline_action.cc: int verbose,
cmdline/cmdline_action.cc: verbose, policy,
cmdline/cmdline_simulate.cc: bool always_prompt, int verbose,
cmdline/cmdline_simulate.cc: always_prompt, verbose,
cmdline/cmdline_simulate.cc: if(verbose==0)
cmdline/cmdline_show.cc: int verbose,
cmdline/cmdline_show.cc:static void show_package(pkgCache::PkgIterator pkg, int verbose,
cmdline/cmdline_show.cc: fragments.push_back(prv_lst_frag(pkg.ProvidesList(), true, verbose, _("Provided by")));
cmdline/cmdline_show.cc: int verbose)
cmdline/cmdline_show.cc: if (verbose>0)
cmdline/cmdline_show.cc: if(verbose<2) // Show all archives in a list.
cmdline/cmdline_show.cc: fragments.push_back(prv_lst_frag(ver.ProvidesList(), false, verbose, _("Provides")));
cmdline/cmdline_show.cc: fragments.push_back(prv_lst_frag(ver.ParentPkg().ProvidesList(), true, verbose, _("Provided by")));
cmdline/cmdline_show.cc:static void show_version(pkgCache::VerIterator ver, int verbose,
cmdline/cmdline_show.cc: cw::fragment *f=version_file_fragment(ver, ver.FileList(), verbose);
cmdline/cmdline_show.cc: cw::fragment *f=version_file_fragment(ver, vf, verbose);
cmdline/cmdline_show.cc: // If verbose<2, only show the first file.
cmdline/cmdline_show.cc: if(verbose<2)
cmdline/cmdline_show.cc: int verbose,
cmdline/cmdline_show.cc: if(verbose == 0 || has_explicit_source)
cmdline/cmdline_show.cc: show_version(ver, verbose, term_metrics);
cmdline/cmdline_show.cc: show_package(pkg, verbose, term_metrics);
cmdline/cmdline_show.cc: show_version(ver, verbose, term_metrics);
cmdline/cmdline_show.cc: show_package(pkg, verbose, term_metrics);
cmdline/cmdline_show.cc:bool do_cmdline_show(const string& s, int verbose, const std::shared_ptr<terminal_metrics> &term_metrics)
cmdline/cmdline_show.cc: verbose,
cmdline/cmdline_show.cc: verbose,
cmdline/cmdline_show.cc:int cmdline_show(int argc, char *argv[], int verbose)
cmdline/cmdline_show.cc: if(!do_cmdline_show(argv[i], verbose, term))
cmdline/cmdline_moo.cc:int cmdline_moo(int argc, char *argv[], int verbose)
cmdline/cmdline_moo.cc: switch(verbose)
cmdline/cmdline_moo.h:int cmdline_moo(int argc, char *argv[], int verbose);
cmdline/cmdline_why.h: * \param verbosity How verbose the search should be (if set to a value
cmdline/cmdline_util.h: * \param verbose the verbosity level; controls how many
cmdline/cmdline_util.h: int verbose,
cmdline/cmdline_user_tag.cc: int verbose,
cmdline/cmdline_user_tag.cc: if (operation_result && verbose>0)
cmdline/cmdline_user_tag.cc: int verbose)
cmdline/cmdline_user_tag.cc: print_result(act, tag, pkg, verbose, op_result);
cmdline/cmdline_user_tag.cc: int cmdline_user_tag(int argc, char *argv[], int quiet, int verbose)
cmdline/cmdline_user_tag.cc: bool result = do_user_tag(action, tag, pkg, verbose);
cmdline/cmdline_user_tag.cc: bool result = do_user_tag(action, tag, pkg, verbose);
cmdline/cmdline_do_action.h: int verbose);
cmdline/cmdline_update.cc:int cmdline_update(int argc, char *argv[], int verbose)
cmdline/cmdline_update.cc: (cmdline_do_download(&m, verbose, term, term, term, term)
cmdline/cmdline_util.cc: int verbose,
cmdline/cmdline_util.cc: verbose >= 1, verbose >= 2,
cmdline/cmdline_show.h: * \param verbose How much information to render (scale of 0 to 2 inclusive).
cmdline/cmdline_show.h: int verbose);
cmdline/cmdline_show.h: int verbose,
cmdline/cmdline_show.h:int cmdline_show(int argc, char *argv[], int verbose);
cmdline/cmdline_action.h: * \param verbose The verbosity level at which this command should
cmdline/cmdline_action.h: int verbose,
cmdline/cmdline_action.h: * \param verbose The verbosity level at which this command should
cmdline/cmdline_action.h: int verbose,
cmdline/cmdline_action.h: * \param verbose The verbosity level at which this command should
cmdline/cmdline_action.h: int verbose,
cmdline/cmdline_do_action.cc: bool queue_only, int verbose)
cmdline/cmdline_do_action.cc: verbose, policy, arch_only, pass > 0,
cmdline/cmdline_do_action.cc: if(!aptitude::cmdline::safe_resolve_deps(verbose,
cmdline/cmdline_do_action.cc: always_prompt, verbose, assume_yes,
cmdline/cmdline_do_action.cc: always_prompt, verbose, assume_yes,
cmdline/cmdline_do_action.cc: (cmdline_do_download(&m, verbose, term, term, term, term)
cmdline/cmdline_prompt.cc: int verbose,
cmdline/cmdline_prompt.cc: make_cmdline_why_callbacks(verbose, term_metrics);
cmdline/cmdline_prompt.cc: if(verbose > 1)
cmdline/cmdline_prompt.cc: else if(verbose > 0)
cmdline/cmdline_prompt.cc: * \param verbose controls various aspects of how verbose the list is.
cmdline/cmdline_prompt.cc: int verbose,
cmdline/cmdline_prompt.cc: std::string whystring(roots_string(*i, verbose, term_metrics));
cmdline/cmdline_prompt.cc: int verbose,
cmdline/cmdline_prompt.cc: verbose,
cmdline/cmdline_prompt.cc: cmdline_show_instinfo(recommended, verbose, showvers, showdeps, showsize, false, showwhy, term_metrics);
cmdline/cmdline_prompt.cc: if(verbose>0 && !suggested.empty())
cmdline/cmdline_prompt.cc: cmdline_show_instinfo(suggested, verbose, showvers, showdeps, showsize, false, showwhy, term_metrics);
cmdline/cmdline_prompt.cc: if (verbose>0 && ! not_upgraded.empty())
cmdline/cmdline_prompt.cc: cmdline_show_instinfo(not_upgraded, verbose, showvers, showdeps, showsize, false, showwhy, term_metrics);
cmdline/cmdline_prompt.cc: int verbose,
cmdline/cmdline_prompt.cc: do_cmdline_show(*it, verbose, term_metrics);
cmdline/cmdline_prompt.cc: int verbose,
cmdline/cmdline_prompt.cc: showvers, showdeps, showsize, showwhy, verbose,
cmdline/cmdline_prompt.cc: verbose,
cmdline/cmdline_prompt.cc: verbose, term_metrics);
cmdline/cmdline_prompt.cc: cmdline_parse_show(response, verbose, term_metrics);
cmdline/cmdline_prompt.cc: to_remove, to_purge, verbose,
cmdline/cmdline_user_tag.h: int cmdline_user_tag(int argc, char *argv[], int quiet, int verbose);
cmdline/cmdline_simulate.h: * \param verbose the current verbosity level
cmdline/cmdline_simulate.h: bool always_prompt, int verbose,
cmdline/cmdline_prompt.h: * \param verbose the current verbosity level
cmdline/cmdline_prompt.h: int verbose,
cmdline/cmdline_prompt.h: int verbose,
cmdline/cmdline_resolver.h: * \param verbose the verbosity level set by the user
cmdline/cmdline_resolver.h: int verbose,
cmdline/cmdline_resolver.h: * \param verbose The verbosity level (increase to get more
cmdline/cmdline_resolver.h: bool safe_resolve_deps(int verbose,
cmdline/cmdline_resolver.cc: int verbose,
cmdline/cmdline_resolver.cc: to_remove, to_purge, verbose,
cmdline/cmdline_resolver.cc: bool safe_resolve_deps(int verbose,
cmdline/cmdline_update.h:int cmdline_update(int argc, char *argv[], int verbose);
main.cc: {"verbose", 0, NULL, 'v'},
main.cc: int verbose=aptcfg->FindI(PACKAGE "::CmdLine::Verbose", 0);
main.cc: ++verbose;
main.cc: return cmdline_update(argc-optind, argv+optind, verbose);
main.cc: status_fname, verbose,
main.cc: status_fname, verbose,
main.cc: arch_only, queue_only, verbose);
main.cc: quiet, verbose);
main.cc: return cmdline_moo(argc-optind, argv+optind, verbose);
main.cc: return cmdline_show(argc-optind, argv+optind, verbose);
我们看到 verbose 变量在 main.cc 中递增:
// Read the arguments:
while((curopt=getopt_long(argc, argv, "DVZWvhS:uiF:w:sO:fdyPt:q::Rro:", opts, NULL))!=-1)
{
switch(curopt)
{
//Other options
case 'v':
++verbose;
break;
//Other options
这意味着每次 av
出现在命令行的选项中都会增加 1。但是测试的verbose
最大数值是在 中。verbose
2
verbose>=2
这意味着-vv
在命令行中拥有更多内容是没有用的。
编辑
更直接的,我们在cmdline_show.h中看到
* \param verbose How much information to render (scale of 0 to 2 inclusive).