mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 20:42:59 +01:00
f9f3b8d938
c1d61fb
Add warning if -blockminsize is used. (Suhas Daftuar)27362dd
Remove -blockminsize option (Suhas Daftuar)d2e46e1
Remove addScoreTxs() (Suhas Daftuar)6dd4bc2
Exclude witness transactions in addPackageTxs() pre-segwit activation (Suhas Daftuar)f15c2cd
CreateNewBlock: add support for size-accounting to addPackageTxs (Suhas Daftuar)
46 lines
1.7 KiB
Python
Executable File
46 lines
1.7 KiB
Python
Executable File
#!/usr/bin/env python
|
|
# Copyright (c) 2015 The Bitcoin Core developers
|
|
# Distributed under the MIT software license, see the accompanying
|
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
'''
|
|
This checks if all command line args are documented.
|
|
Return value is 0 to indicate no error.
|
|
|
|
Author: @MarcoFalke
|
|
'''
|
|
|
|
from subprocess import check_output
|
|
import re
|
|
|
|
FOLDER_GREP = 'src'
|
|
FOLDER_TEST = 'src/test/'
|
|
CMD_ROOT_DIR = '`git rev-parse --show-toplevel`/%s' % FOLDER_GREP
|
|
CMD_GREP_ARGS = r"egrep -r -I '(map(Multi)?Args(\.count\(|\[)|Get(Bool)?Arg\()\"\-[^\"]+?\"' %s | grep -v '%s'" % (CMD_ROOT_DIR, FOLDER_TEST)
|
|
CMD_GREP_DOCS = r"egrep -r -I 'HelpMessageOpt\(\"\-[^\"=]+?(=|\")' %s" % (CMD_ROOT_DIR)
|
|
REGEX_ARG = re.compile(r'(?:map(?:Multi)?Args(?:\.count\(|\[)|Get(?:Bool)?Arg\()\"(\-[^\"]+?)\"')
|
|
REGEX_DOC = re.compile(r'HelpMessageOpt\(\"(\-[^\"=]+?)(?:=|\")')
|
|
# list unsupported, deprecated and duplicate args as they need no documentation
|
|
SET_DOC_OPTIONAL = set(['-rpcssl', '-benchmark', '-h', '-help', '-socks', '-tor', '-debugnet', '-whitelistalwaysrelay', '-blockminsize'])
|
|
|
|
def main():
|
|
used = check_output(CMD_GREP_ARGS, shell=True)
|
|
docd = check_output(CMD_GREP_DOCS, shell=True)
|
|
|
|
args_used = set(re.findall(REGEX_ARG,used))
|
|
args_docd = set(re.findall(REGEX_DOC,docd)).union(SET_DOC_OPTIONAL)
|
|
args_need_doc = args_used.difference(args_docd)
|
|
args_unknown = args_docd.difference(args_used)
|
|
|
|
print "Args used : %s" % len(args_used)
|
|
print "Args documented : %s" % len(args_docd)
|
|
print "Args undocumented: %s" % len(args_need_doc)
|
|
print args_need_doc
|
|
print "Args unknown : %s" % len(args_unknown)
|
|
print args_unknown
|
|
|
|
exit(len(args_need_doc))
|
|
|
|
if __name__ == "__main__":
|
|
main()
|