Background:
I switched to the new linux ubuntu which wouldnt work with my wifi card for some reason but because it had c and c++ compilers i was too lazy to switch back. the only problem was whenever i made a mistake it was like at line 58 or 129. and because i couldnt download an ide i had to count it by hand so i made a program that can do one of three things depending on its arguements.
1) count the total lines in a program
2) find a specified string and tell you the line its on
3) input a number and it will tell you what that line is
It looks nice. What happens if I only want to find what's at line n? Sounds like I'd still need to put in 3 arguments.
Something that would be pretty fun to do, is actually break this into three different programs and turn them into programs that your shell can call. Adding shell commands is pretty fun, and this sounds like a useful one. Though I'm not sure if you're duplicating anything *nix already provides.
To count the lines in a file, you can use wc; to find a string you use grep (it doesn't tell you the line number but it does display the whole line). I don't know about the third thing.
Sounds like pretty typical programmer behaviour to me: "Rather than figure out how to use these pre-supplied tools the way the developers intended, I'll just make my own ones". I once spent a day writing a basic version of an X Window System tool called mkfontdir because I couldn't find one online (in about two minutes of searching -- secretly I think I just wanted to do it myself) and my system didn't seem to have one. I don't even know exactly what mkfontdir does or what it's for (I know it generates fonts.dir files but I don't know what they are or what they do), I just had the man page. It didn't work in the end and I can't even remember why I needed it, but yeah, IMO doing stupid things like that is normal.
mine you only need two or one args lineFind fileName will tell you how many lines are in a file. lineFind fileName int will tell you whats on line int. lineFind filename string will tell you what line what line string is on. and yes i know there were pre made tools for this but i just felt like making my own so i could have it in one program
I switched to the new linux ubuntu which wouldnt work with my wifi card for some reason
That's easy to fix, all you need to do is go into the terminal thing, type 3 pages of text (you can find it in google) and hit the enter key. Just make sure you didn't mistype anything, or you might trash your operating system. There's also the slim possibility of losing some of your hair over the ordeal.
Now that I'm done ripping on both Linux customer and hardware support, I'll contribute something useful:
You might consider printing the intended usage if an invalid number of arguments are provided. Black box utilities are only as useful as they are intuitive, so instead of "error: too few arguments", you could perhaps print out an intuitive course of action for the end-user to take in order to resolve their misunderstanding.