Skip to content

Commit

Permalink
Added xml output
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmarsh committed Apr 15, 2024
1 parent 4d5fb8f commit 5a557a8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

| Version | Supported |
| ------- | ------------------ |
| 1.1.0 | :white_check_mark: |
| 1.0.6 | :white_check_mark: |
| 1.0.5 | :white_check_mark: |
| 1.0.4 | :x: |
Expand Down
4 changes: 2 additions & 2 deletions _jnja/elm.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
__project__ = 'elm'
__appname__ = 'elm'
__appdesc__ = 'A cli interface for extracting LogicMonitor data via the api'
__version__ = '1.0.6'
__version__ = '1.1.0'
__author__ = 'David Marsh'
__license__ = 'GPLv3'
__copyright__ = 'Copyright 2021--2024 David Marsh'
Expand Down Expand Up @@ -81,7 +81,7 @@ def good_perms(file):
@click.option('-k', '--access_key', help='API token access key')
@click.option('-a', '--account_name', help='LogicMonitor account (company) name')
@click.option('-s', '--proxy', type=(str, int), default=(None, 1080), metavar='<HOST PORT>', help='Socks5 proxy address and port')
@click.option('-f', '--format', default='json', show_default=True, type=click.Choice(['csv', 'html', 'prettyhtml', 'jira', 'json', 'prettyjson', 'gfm', 'latex', 'md', 'pipe', 'rst', 'tab', 'raw', 'txt', 'api']), help='Format of data')
@click.option('-f', '--format', default='json', show_default=True, type=click.Choice(['csv', 'html', 'prettyhtml', 'jira', 'json', 'prettyjson', 'xml', 'gfm', 'latex', 'md', 'pipe', 'rst', 'tab', 'raw', 'txt', 'api']), help='Format of data')
@click.option('-H', '--noheaders', is_flag=True, default=False, show_default=True, help="Hide the column headers")
@click.option('-I', '--index', is_flag=True, default=False, show_default=True, help="Show the row indices")
@click.option('-o', '--filename', type=click.Path(exists=False, file_okay=True, dir_okay=False, writable=True, allow_dash=True), default='-', show_default=True, help='Output to file name')
Expand Down
2 changes: 2 additions & 0 deletions _jnja/engine.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ def output(items, command, filename='-', format='json', noheaders=False, index=F
formatted_json=json.dumps({command: items}, sort_keys=True, indent=2)
colorful_json = highlight(formatted_json, lexers.JsonLexer(), formatters.TerminalFormatter())
output = colorful_json.rstrip("\n")
elif format == 'xml':
output = df.to_xml()
elif format == 'gfm':
output = tabulate(df, headers=colheads, showindex=index, tablefmt="github", floatfmt='.0f')
elif format == 'latex':
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ click_config_file~=0.6.0
click~=7.1.2
htmlmin~=0.1.12
Jinja2~=3.1.2
lxml~=5.2.1
packaging~=23.2
pandas~=1.5.3
Pygments~=2.15.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='elm',
version='1.0.6',
version='1.1.0',
description='Install elm',
url='https://github.com/rdmarsh/elm',
author='David Marsh',
Expand Down

0 comments on commit 5a557a8

Please sign in to comment.