add print_usage function
This commit is contained in:
parent
7445550a57
commit
c18c53b9bd
26
src/sort.c
26
src/sort.c
@ -13,6 +13,32 @@
|
|||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Imprimir el uso del programa
|
||||||
|
*/
|
||||||
|
void print_usage() {
|
||||||
|
fprintf(stdout, "uso: sort [OPCIÓN]\n");
|
||||||
|
fprintf(stdout, " -m, --merge usar merge sort\n");
|
||||||
|
fprintf(stdout, " -q, --quick usar quick sort\n");
|
||||||
|
fprintf(stdout, " -b, --bubble usar bubble sort\n");
|
||||||
|
fprintf(stdout, " -B, --bitonic usar bitonic sort\n");
|
||||||
|
fprintf(stdout, " -c, --count usar ordenamiento por conteo\n");
|
||||||
|
fprintf(stdout, " -s, --selection usar ordenamiento por selección\n");
|
||||||
|
fprintf(stdout, " -n, --n=N la cantidad de elementos a ordenar, la\n");
|
||||||
|
fprintf(stdout, " cantidad predeterminado es 10\n");
|
||||||
|
fprintf(stdout, " -e, --elegir el usuario debe elegir los \"n\" valores de\n");
|
||||||
|
fprintf(stdout, " elementos a ordenar, sin esta opción los\n");
|
||||||
|
fprintf(stdout, " valores son elegido por el programa al azar\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* La entrada del programa
|
||||||
|
* @param argc La cantidad de argumentos pasado al programa
|
||||||
|
* @return Returna el codigo de error o 0 por exito
|
||||||
|
*/
|
||||||
int main (int argc, char **argv) {
|
int main (int argc, char **argv) {
|
||||||
|
print_usage();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user