Is this a good way of implementing an optional command line argument?

I'm very new to C so this might be an obvious problem to solve, but this is my way of checking for an optional command line argument, and changing mode based on that. Is this a safe solution?

int mode = 0; // default mode 0: relative pathing; 1 is exact pathing

int force = 0; // default force 0: dont overwrite; 1 to force writing

if (argv[1] == NULL || argv[2] == NULL) {

printf("mv: expected 2 arguments, \"mv [source] [dest]\"");

return 1;

}

if (strcmp(argv[1], "-f") == 0) {

char ch;

printf("force overwrite? (y/N): ");

fflush(stdout);

ch = getchar();

if (ch == 'y' || ch == 'Y') {

force = 1;

} else {

return 1;

}

}

if (1) {

printf("mode: %i\n", mode);

printf("force: %i\n", force);

printf("argc: %i\n", argc);

for (size_t i = 0; argv[i]; i++) {

printf("%s\n", argv[i]);

}

}

reddit.com
u/Specialist-Signal598 — 2 days ago
▲ 2 r/webdev

Can i add animation offset without delaying when the animation starts?

I'm using this css tutorial on my personal website and I really like this effect. My application had 13 characters so the delay on each character starting the animation is really noticeable. Is there a way for me to offset the animation without the animation actually taking that long to begin?

Here is my css:

body {

display: flex;

justify-content: center;

align-items: center;

margin: 0;

background: #101010;

color: #fff;

}

.wave-text span {

display: inline-block;

font-size: 4rem;

animation: wave 2s ease-in-out infinite;

}

.wave-text span:nth-child(1) {

animation-delay: 0s;

}

.wave-text span:nth-child(2) {

animation-delay: 0.2s;

}

.wave-text span:nth-child(3) {

animation-delay: 0.4s;

}

.wave-text span:nth-child(4) {

animation-delay: 0.6s;

}

.wave-text span:nth-child(5) {

animation-delay: 0.8s;

}

.wave-text span:nth-child(6) {

animation-delay: 1s;

}

.wave-text span:nth-child(7) {

animation-delay: 1.2s;

}

.wave-text span:nth-child(8) {

animation-delay: 1.4s;

}

.wave-text span:nth-child(9) {

animation-delay: 1.6s;

}

.wave-text span:nth-child(10) {

animation-delay: 1.8s;

}

.wave-text span:nth-child(11) {

animation-delay: 2s;

}

.wave-text span:nth-child(12) {

animation-delay: 2.2s;

}

.wave-text span:nth-child(13) {

animation-delay :2.4s;

}

.@keyframes wave {

0%, 100% {

transform: translateY(0);

}

50% {

transform: translateY(-20px);

}

}

(I put a dot in front of the keyframes so it wouldnt register as a reddit user)

Thank you!

u/Specialist-Signal598 — 9 days ago
▲ 1 r/Hair

i always loose body and get really frizzy when i brush out my hair after it air dries, what products / methods can keep the body and texture after brushing?

u/Specialist-Signal598 — 2 months ago