I added a cli for my tool:
import os
import click
from shapefile import Reader
from .dfs_path_test import show_upstream_stations_graph, show_downstream_stations, upstream_node_on_mainstream, write_path_file
@click.command(context_settings=dict(help_option_names=['-h', '--help']))
@click.option('--outdated', is_flag=False, help='decide regenerate cache files or not')
@click.option('--nodes_path', help='path of nodes shape file')
@click.option('--river_path', help='path of river vector shape file')
@click.option('--cur_sta', help='number of current station')
@click.option('--up_sta', help='number of station which will be judge in mainstream or tributary in upstream watershed of current station')
@click.option('--cutoff', help='amount of stations which user want to limit')
@click.option('--upstream', is_flag=False, help='output upstream stations graph of current station')
@click.option('--downstream', is_flag=False, help='output list of downstream stations of current station')
@click.option('--output_dir', help='when outdated is true,choose directory which you want to put your cache file')
@click.option('--cache_dir', help='when outdated if false,choose directory where put cache file')
def main(outdated, nodes_path, river_path, cur_sta, up_sta, cutoff, upstream, downstream, cache_dir, output_dir):
……
if __name__ == '__main__':
main()
This is my setup.py configuration:
entry_points={'console_scripts': ['calcstream = dijkstra_conda.cli:main']},
But when I input command of the cli,it has no any result:
PS C:\Users\k6789> calcstream --nodes_path C:\Users\……\near_changchun_dots.shp --river_path C:\Users\……\near_changchun_cut.shp --outdated True --output_dir C:\Users\XXX\Desktop
I can't see any text in my powershell window and there is no any file on my desktop,so where is my mistake?