blob: c7df216112216bfad014246c66d51ece8b089f64 [file] [log] [blame]
Erik Andersene49d5ec2000-02-08 19:58:47 +00001/* vi: set sw=4 ts=4: */
Eric Andersencc8ed391999-10-05 16:24:54 +00002#include "internal.h"
3#include <stdlib.h>
4#include <string.h>
5#include <stdio.h>
6
Erik Andersene49d5ec2000-02-08 19:58:47 +00007extern int length_main(int argc, char **argv)
Eric Andersencc8ed391999-10-05 16:24:54 +00008{
Erik Andersene49d5ec2000-02-08 19:58:47 +00009 if (argc != 2 || **(argv + 1) == '-') {
Erik Andersen7ab9c7e2000-05-12 19:41:47 +000010 usage("length STRING\n"
11#ifndef BB_FEATURE_TRIVIAL_HELP
12 "\nPrints out the length of the specified STRING.\n"
13#endif
14 );
Erik Andersene49d5ec2000-02-08 19:58:47 +000015 }
Erik Andersen1d1d9502000-04-21 01:26:49 +000016 printf("%lu\n", (long)strlen(argv[1]));
Erik Andersene49d5ec2000-02-08 19:58:47 +000017 return (TRUE);
Eric Andersencc8ed391999-10-05 16:24:54 +000018}