By default don't dump every single option on the user, but print only the basic options. Add -h long/full to print more options.
Unified · Split
| @@ -1791,30 +1791,56 @@ static int opt_filter_complex(const char *opt, const char *arg) · 1790 unmodified lines | ||
| 1791 | 1791 | |
| 1792 | 1792 | void show_help_default(const char *opt, const char *arg) |
| 1793 | 1793 | { |
| 1794 | − int flags = AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM; | |
| 1794 | + int show_advanced = 0, show_avoptions = 0; | |
| 1795 | + | |
| 1796 | + if (opt) { | |
| 1797 | + if (!strcmp(opt, "long")) | |
| 1798 | + show_advanced = 1; | |
| 1799 | + else if (!strcmp(opt, "full")) | |
| 1800 | + show_advanced = show_avoptions = 1; | |
| 1801 | + else | |
| 1802 | + av_log(NULL, AV_LOG_ERROR, "Unknown help option '%s'.\n", opt); | |
| 1803 | + } | |
| 1795 | 1804 | |
| 1796 | 1805 | show_usage(); |
| 1806 | + | |
| 1807 | + printf("Getting help:\n" | |
| 1808 | + " -h -- print basic options\n" | |
| 1809 | + " -h long -- print more options\n" | |
| 1810 | + " -h full -- print all options (including all format and codec specific options, very long)\n" | |
| 1811 | + " See man %s for detailed description of the options.\n" | |
| 1812 | + "\n", program_name); | |
| 1813 | + | |
| 1797 | 1814 | show_help_options(options, "Print help / information / capabilities:", |
| 1798 | 1815 | OPT_EXIT, 0); |
| 1799 | 1816 | show_help_options(options, "Main options:", |
| 1800 | 1817 | 0, OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE | |
| 1801 | 1818 | OPT_EXIT); |
| 1802 | − show_help_options(options, "Advanced options:", | |
| 1803 | − OPT_EXPERT, OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE); | |
| 1819 | + if (show_advanced) | |
| 1820 | + show_help_options(options, "Advanced options:", | |
| 1821 | + OPT_EXPERT, OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE); | |
| 1822 | + | |
| 1804 | 1823 | show_help_options(options, "Video options:", |
| 1805 | 1824 | OPT_VIDEO, OPT_EXPERT | OPT_AUDIO); |
| 1806 | − show_help_options(options, "Advanced Video options:", | |
| 1807 | − OPT_EXPERT | OPT_VIDEO, OPT_AUDIO); | |
| 1825 | + if (show_advanced) | |
| 1826 | + show_help_options(options, "Advanced Video options:", | |
| 1827 | + OPT_EXPERT | OPT_VIDEO, OPT_AUDIO); | |
| 1828 | + | |
| 1808 | 1829 | show_help_options(options, "Audio options:", |
| 1809 | 1830 | OPT_AUDIO, OPT_EXPERT | OPT_VIDEO); |
| 1810 | − show_help_options(options, "Advanced Audio options:", | |
| 1811 | − OPT_EXPERT | OPT_AUDIO, OPT_VIDEO); | |
| 1831 | + if (show_advanced) | |
| 1832 | + show_help_options(options, "Advanced Audio options:", | |
| 1833 | + OPT_EXPERT | OPT_AUDIO, OPT_VIDEO); | |
| 1812 | 1834 | show_help_options(options, "Subtitle options:", |
| 1813 | 1835 | OPT_SUBTITLE, 0); |
| 1814 | 1836 | printf("\n"); |
| 1815 | − show_help_children(avcodec_get_class(), flags); | |
| 1816 | − show_help_children(avformat_get_class(), flags); | |
| 1817 | − show_help_children(sws_get_class(), flags); | |
| 1837 | + | |
| 1838 | + if (show_avoptions) { | |
| 1839 | + int flags = AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM; | |
| 1840 | + show_help_children(avcodec_get_class(), flags); | |
| 1841 | + show_help_children(avformat_get_class(), flags); | |
| 1842 | + show_help_children(sws_get_class(), flags); | |
| 1843 | + } | |
| 1818 | 1844 | } |
| 1819 | 1845 | |
| 1820 | 1846 | void show_usage(void) |