Skip to content

Commit

Permalink
Move command description to docstring
Browse files Browse the repository at this point in the history
As suggested in code review, this adds an actual docstring to the
script, and reuses the docstring as the ArgumentParser description.
  • Loading branch information
lunkwill42 committed Nov 13, 2023
1 parent bc6265c commit b9a8398
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bin/navsnmp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
# details. You should have received a copy of the GNU General Public License
# along with NAV. If not, see <http://www.gnu.org/licenses/>.
#
"""Outputs NAV's SNMP configuration for input devices as NET-SNMP compatible command
line arguments.
"""
from __future__ import print_function
import argparse
import sys
Expand Down Expand Up @@ -41,8 +45,7 @@ def main():
def parse_args():
"""Builds an ArgumentParser and returns parsed program arguments"""
parser = argparse.ArgumentParser(
description="Outputs NAV's SNMP configuration of input devices as NET-SNMP "
"compatible command line arguments",
description=__doc__.replace("\n", " ").strip(),
epilog="Example usage:\nsnmpwalk $(%(prog)s example-sw.example.org) "
"SNMPv2-MIB::system ",
)
Expand Down

0 comments on commit b9a8398

Please sign in to comment.