o
�Y�e c @ sp d dl Z d dlZd dlmZ d dlmZ ddd�Zdee fdd�Z dee fd d
�Z
dedee fdd
�ZdS )i N)�Optional)�InvalidFeatureErrorc
C s� t �� }|jdddd� |�� }|jddd�}|jddd d
d� |jdd
d dd� |jddd dd� |jddddd� |jdd� |jddd�}|jddddd� |jddd dd� |jdd� |jddd�}|jdddd d� |jddd dd� |jdd� |jd!d"d�}|jd!d� |jd#d$d�}|jd#d� |jd%d&d�}|jd%d� |jd'd(d�} | jd'd� |jd)d*d�}
|
jd#d+d� |
jd)d� |jd,d-d�}|jd#d.d� |jd,d� |jd/d0d�}|jd/d� | r�|�| �S |�� S )1z�
Constructs the command-line argument parser for cargo2rpm.
If arguments are passed to this function, they are parsed instead of parsing
actual command line arguments. This is useful for testing parser behaviour.
z-pz--pathz8Path to Cargo.toml (for current crate or workspace root))�helpZ
buildrequiresz*Print BuildRequires for the current crate.z-tz--with-checkZ
store_truezInclude dev-dependencies.)�actionr z-az--all-featureszEnable all featuresz-nz--no-default-featureszDisable default featuresz-fz-Fz
--featuresz*Comma-separated list of features to enable)r Zrequiresz;Print Requires for the current crate and the given feature.z --featurez-Name of the feature to generate Requires for.z-sz--subpackagez(Treat the argument as a subpackage name.Zprovidesz;Print Provides for the current crate and the given feature.z-Name of the feature to generate Provides for.Znamez$Print the name of the current crate.Zversionz'Print the version of the current crate.zis-libzDPrint 1 if the current crate is a library target, otherwise print 0.zis-binzCPrint 1 if the current crate has binary targets, otherwise print 0.Z
semver2rpmz7Convert SemVer version string to equivalent RPM format.zSemVer compliant version stringZ
rpm2semverz7Convert RPM version string to equivalent SemVer format.zRPM version stringzparse-vendor-manifestz:Parse vendor manifest generated by %%cargo_vendor_manifest)�argparseZArgumentParserZadd_argumentZadd_subparsersZ
add_parserZset_defaultsZ
parse_args)
ZargsZparserZaction_parsersZ
action_brsZ
action_reqZaction_provZaction_nameZaction_versionZ
action_is_libZ
action_is_binZaction_semver_to_rpmZaction_rpm_to_semverZaction_parse_vendor_manifest� r �3/home/deca/Projects/rust/cargo2rpm/cargo2rpm/cli.py�get_args sL �
r Zreturnc C �"